UNPKG

731 BJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = gql;
7
8var _graphql = require('graphql');
9
10function gql(literals, ...interpolations) {
11 if (literals.length !== 1 || interpolations.length) {
12 throw new Error('The gql template tag does not support interpolation.');
13 }
14 return (0, _graphql.parse)(literals[0]);
15} /**
16 * This module only exists because as of this writing, `graphql-tag` doesn't
17 * support type, field, or argument descriptions. That's a bummer, so this
18 * simple tag is provided instead. It doesn't support any type of interpolation
19 * whatsoever, but will parse the GraphQL document, allow syntax highlighting,
20 * and enable Prettier formatting.
21 */
\No newline at end of file