graphql-tag 2.10.3 → 2.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Change log
2
2
 
3
+ ### v2.12.1
4
+
5
+ * To accommodate older versions of TypeScript, usage of the `import type ...` syntax (introduced by [#325](https://github.com/apollographql/graphql-tag/pull/325)) has been removed, fixing issue [#345](https://github.com/apollographql/graphql-tag/issues/345). <br/>
6
+ [@benjamn](http://github.com/benjamn) in [#352](https://github.com/apollographql/graphql-tag/pull/352)
7
+
8
+ ### v2.12.0
9
+
10
+ * The `graphql-tag` repository has been converted to TypeScript, adding type safety and enabling both ECMAScript and CommonJS module exports. While these changes are intended to be as backwards-compatible as possible, we decided to bump the minor version to reflect the significant refactoring. <br/>
11
+ [@PowerKiKi](http://github.com/PowerKiKi) and [@benjamn](http://github.com/benjamn) in [#325](https://github.com/apollographql/graphql-tag/pull/325)
12
+
13
+ ### v2.11.0 (2020-07-28)
14
+
15
+ * `package.json` `sideEffects` changes to clearly identify that `graphql-tag` doesn't have side effects. <br/>
16
+ [@hwillson](http://github.com/hwillson) in [#313](https://github.com/apollographql/graphql-tag/pull/313)
17
+
18
+ ### v2.10.4 (2020-07-08)
19
+
20
+ * Bump dev/peer deps to accommodate `graphql` 15. <br/>
21
+ [@adriencohen](https://github.com/adriencohen) in [#299](https://github.com/apollographql/graphql-tag/pull/299)
22
+
3
23
  ### v2.10.3 (2020-02-05)
4
24
 
5
25
  * Further adjustments to the TS `index.d.ts` declaration file. <br/>
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Meteor Development Group, Inc.
3
+ Copyright (c) 2021 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -8,11 +8,11 @@ Helpful utilities for parsing GraphQL queries. Includes:
8
8
  - `gql` A JavaScript template literal tag that parses GraphQL query strings into the standard GraphQL AST.
9
9
  - `/loader` A webpack loader to preprocess queries
10
10
 
11
- `graphql-tag` uses [the reference `graphql` library](https://github.com/graphql/graphql-js) under the hood as a peer dependency, so in addition to installing this module, you'll also have to install `graphql-js`.
11
+ `graphql-tag` uses [the reference `graphql` library](https://github.com/graphql/graphql-js) under the hood as a peer dependency, so in addition to installing this module, you'll also have to install `graphql`.
12
12
 
13
13
  ### gql
14
14
 
15
- This is a template literal tag you can use to concisely write a GraphQL query that is parsed into the standard GraphQL AST:
15
+ The `gql` template literal tag can be used to concisely write a GraphQL query that is parsed into a standard GraphQL AST. It is the recommended method for passing queries to [Apollo Client](https://github.com/apollographql/apollo-client). While it is primarily built for Apollo Client, it generates a generic GraphQL AST which can be used by any GraphQL client.
16
16
 
17
17
  ```js
18
18
  import gql from 'graphql-tag';
@@ -25,34 +25,68 @@ const query = gql`
25
25
  }
26
26
  }
27
27
  `
28
+ ```
29
+
30
+ The above query now contains the following syntax tree.
31
+
32
+ ```js
33
+ {
34
+ "kind": "Document",
35
+ "definitions": [
36
+ {
37
+ "kind": "OperationDefinition",
38
+ "operation": "query",
39
+ "name": null,
40
+ "variableDefinitions": null,
41
+ "directives": [],
42
+ "selectionSet": {
43
+ "kind": "SelectionSet",
44
+ "selections": [
45
+ {
46
+ "kind": "Field",
47
+ "alias": null,
48
+ "name": {
49
+ "kind": "Name",
50
+ "value": "user",
51
+ ...
52
+ }
53
+ }
54
+ ]
55
+ }
56
+ }
57
+ ]
58
+ }
59
+ ```
60
+
61
+ #### Fragments
62
+
63
+ The `gql` tag can also be used to define reusable fragments, which can easily be added to queries or other fragments.
64
+
65
+ ```js
66
+ import gql from 'graphql-tag';
28
67
 
29
- // query is now a GraphQL syntax tree object
30
- console.log(query);
31
-
32
- // {
33
- // "kind": "Document",
34
- // "definitions": [
35
- // {
36
- // "kind": "OperationDefinition",
37
- // "operation": "query",
38
- // "name": null,
39
- // "variableDefinitions": null,
40
- // "directives": [],
41
- // "selectionSet": {
42
- // "kind": "SelectionSet",
43
- // "selections": [
44
- // {
45
- // "kind": "Field",
46
- // "alias": null,
47
- // "name": {
48
- // "kind": "Name",
49
- // "value": "user",
50
- // ...
68
+ const userFragment = gql`
69
+ fragment User_user on User {
70
+ firstName
71
+ lastName
72
+ }
73
+ `
51
74
  ```
52
75
 
53
- You can easily explore GraphQL ASTs on [astexplorer.net](https://astexplorer.net/#/drYr8X1rnP/1).
76
+ The above `userFragment` document can be embedded in another document using a template literal placeholder.
77
+
78
+ ```js
79
+ const query = gql`
80
+ {
81
+ user(id: 5) {
82
+ ...User_user
83
+ }
84
+ }
85
+ ${userFragment}
86
+ `
87
+ ```
54
88
 
55
- This package is the way to pass queries into [Apollo Client](https://github.com/apollographql/apollo-client). If you're building a GraphQL client, you can use it too!
89
+ **Note:** _While it may seem redundant to have to both embed the `userFragment` variable in the template literal **AND** spread the `...User_user` fragment in the graphQL selection set, this requirement makes static analysis by tools such as `eslint-plugin-graphql` possible._
56
90
 
57
91
  #### Why use this?
58
92
 
@@ -64,78 +98,100 @@ That's where this package comes in - it lets you write your queries with [ES2015
64
98
 
65
99
  This package only has one feature - it caches previous parse results in a simple dictionary. This means that if you call the tag on the same query multiple times, it doesn't waste time parsing it again. It also means you can use `===` to compare queries to check if they are identical.
66
100
 
67
- ### Babel preprocessing
68
101
 
69
- GraphQL queries can be compiled at build time using [babel-plugin-graphql-tag](https://github.com/gajus/babel-plugin-graphql-tag). Pre-compiling queries decreases the script initialization time and reduces the bundle size by potentially removing the need for `graphql-tag` at runtime.
102
+ ### Importing graphQL files
70
103
 
71
- #### TypeScript
72
- Try this custom transformer to pre-compile your GraphQL queries in TypeScript: [ts-transform-graphql-tag](https://github.com/firede/ts-transform-graphql-tag).
104
+ _To add support for importing `.graphql`/`.gql` files, see [Webpack loading and preprocessing](#webpack-loading-and-preprocessing) below._
73
105
 
74
- #### React Native, Next.js
106
+ Given a file `MyQuery.graphql`
75
107
 
76
- Additionally, in certain situations, preprocessing queries via the webpack loader is not possible. [babel-plugin-import-graphql](https://www.npmjs.com/package/babel-plugin-import-graphql) will allow one to import graphql files directly into your JavaScript by preprocessing GraphQL queries into ASTs at compile-time.
108
+ ```graphql
109
+ query MyQuery {
110
+ ...
111
+ }
112
+ ```
77
113
 
78
- E.g.:
79
- ```javascript
80
- import myImportedQuery from './productsQuery.graphql'
114
+ If you have configured [the webpack graphql-tag/loader](#webpack-loading-and-preprocessing), you can import modules containing graphQL queries. The imported value will be the pre-built AST.
81
115
 
82
- class ProductsPage extends React.Component {
116
+ ```graphql
117
+ import MyQuery from 'query.graphql'
118
+ ```
119
+
120
+ #### Importing queries by name
121
+
122
+ You can also import query and fragment documents by name.
123
+
124
+ ```graphql
125
+ query MyQuery1 {
126
+ ...
127
+ }
128
+
129
+ query MyQuery2 {
83
130
  ...
84
131
  }
85
132
  ```
86
133
 
87
- #### Create-React-App
134
+ And in your JavaScript:
88
135
 
89
- `create-react-app@2.0.0` does support the ability to preprocess queries using [evenchange4/graphql.macro](https://github.com/evenchange4/graphql.macro).
136
+ ```javascript
137
+ import { MyQuery1, MyQuery2 } from 'query.graphql'
138
+ ```
90
139
 
91
- If you're using an older version of `create-react-app`, check out [react-app-rewire-inline-import-graphql-ast](https://www.npmjs.com/package/react-app-rewire-inline-import-graphql-ast) to preprocess queries without needing to eject.
140
+ ### Preprocessing queries and fragments
92
141
 
93
- ### Webpack preprocessing with `graphql-tag/loader`
142
+ Preprocessing GraphQL queries and fragments into ASTs at build time can greatly improve load times.
94
143
 
95
- This package also includes a [webpack loader](https://webpack.js.org/concepts/loaders). There are many benefits over this approach, which saves GraphQL ASTs processing time on client-side and enable queries to be separated from script over `.graphql` files.
144
+ #### Babel preprocessing
96
145
 
97
- ```js
98
- loaders: [
99
- {
100
- test: /\.(graphql|gql)$/,
101
- exclude: /node_modules/,
102
- loader: 'graphql-tag/loader'
103
- }
104
- ]
105
- ```
146
+ GraphQL queries can be compiled at build time using [babel-plugin-graphql-tag](https://github.com/gajus/babel-plugin-graphql-tag). Pre-compiling queries decreases script initialization time and reduces bundle sizes by potentially removing the need for `graphql-tag` at runtime.
106
147
 
107
- then:
148
+ #### TypeScript preprocessing
108
149
 
109
- ```js
110
- import query from './query.graphql';
150
+ Try this custom transformer to pre-compile your GraphQL queries in TypeScript: [ts-transform-graphql-tag](https://github.com/firede/ts-transform-graphql-tag).
111
151
 
112
- console.log(query);
113
- // {
114
- // "kind": "Document",
115
- // ...
116
- ```
152
+ #### React Native and Next.js preprocessing
117
153
 
118
- Testing environments that don't support Webpack require additional configuration. For [Jest](https://facebook.github.io/jest/) use [jest-transform-graphql](https://github.com/remind101/jest-transform-graphql).
154
+ Preprocessing queries via the webpack loader is not always possible. [babel-plugin-import-graphql](https://www.npmjs.com/package/babel-plugin-import-graphql) supports importing graphql files directly into your JavaScript by preprocessing GraphQL queries into ASTs at compile-time.
119
155
 
120
- #### Support for multiple operations
156
+ E.g.:
121
157
 
122
- With the webpack loader, you can also import operations by name:
158
+ ```javascript
159
+ import myImportedQuery from './productsQuery.graphql'
123
160
 
124
- In a file called `query.gql`:
125
- ```graphql
126
- query MyQuery1 {
161
+ class ProductsPage extends React.Component {
127
162
  ...
128
163
  }
164
+ ```
129
165
 
130
- query MyQuery2 {
166
+ #### Webpack loading and preprocessing
167
+
168
+ Using the included `graphql-tag/loader` it is possible to maintain query logic that is separate from the rest of your application logic. With the loader configured, imported graphQL files will be converted to AST during the webpack build process.
169
+
170
+ _**Example webpack configuration**_
171
+
172
+ ```js
173
+ {
174
+ ...
175
+ loaders: [
176
+ {
177
+ test: /\.(graphql|gql)$/,
178
+ exclude: /node_modules/,
179
+ loader: 'graphql-tag/loader'
180
+ }
181
+ ],
131
182
  ...
132
183
  }
133
184
  ```
134
185
 
135
- And in your JavaScript:
136
- ```javascript
137
- import { MyQuery1, MyQuery2 } from 'query.gql'
138
- ```
186
+ #### Create React App
187
+
188
+ Preprocessing GraphQL imports is supported in **create-react-app** >= v2 using [evenchange4/graphql.macro](https://github.com/evenchange4/graphql.macro).
189
+
190
+ For **create-react-app** < v2, you'll either need to eject or use [react-app-rewire-inline-import-graphql-ast](https://www.npmjs.com/package/react-app-rewire-inline-import-graphql-ast).
191
+
192
+ #### Testing
193
+
194
+ Testing environments that don't support Webpack require additional configuration. For [Jest](https://facebook.github.io/jest/) use [jest-transform-graphql](https://github.com/remind101/jest-transform-graphql).
139
195
 
140
196
  ### Warnings
141
197
 
@@ -152,13 +208,19 @@ disableFragmentWarnings()
152
208
  This package exports an `experimentalFragmentVariables` flag that allows you to use experimental support for [parameterized fragments](https://github.com/facebook/graphql/issues/204).
153
209
 
154
210
  You can enable / disable this with:
211
+
155
212
  ```js
156
213
  import { enableExperimentalFragmentVariables, disableExperimentalFragmentVariables } from 'graphql-tag';
157
214
  ```
158
215
 
159
216
  Enabling this feature allows you declare documents of the form
217
+
160
218
  ```graphql
161
219
  fragment SomeFragment ($arg: String!) on SomeType {
162
220
  someField
163
221
  }
164
222
  ```
223
+
224
+ ### Resources
225
+
226
+ You can easily generate and explore a GraphQL AST on [astexplorer.net](https://astexplorer.net/#/drYr8X1rnP/1).
@@ -1,189 +1,131 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (factory());
5
- }(this, (function () { 'use strict';
6
-
7
- var parser = require('graphql/language/parser');
8
-
9
- var parse = parser.parse;
10
-
11
- // Strip insignificant whitespace
12
- // Note that this could do a lot more, such as reorder fields etc.
13
- function normalize(string) {
14
- return string.replace(/[\s,]+/g, ' ').trim();
15
- }
16
-
17
- // A map docString -> graphql document
18
- var docCache = {};
19
-
20
- // A map fragmentName -> [normalized source]
21
- var fragmentSourceMap = {};
22
-
23
- function cacheKeyFromLoc(loc) {
24
- return normalize(loc.source.body.substring(loc.start, loc.end));
25
- }
26
-
27
- // For testing.
28
- function resetCaches() {
29
- docCache = {};
30
- fragmentSourceMap = {};
31
- }
32
-
33
- // Take a unstripped parsed document (query/mutation or even fragment), and
34
- // check all fragment definitions, checking for name->source uniqueness.
35
- // We also want to make sure only unique fragments exist in the document.
36
- var printFragmentWarnings = true;
37
- function processFragments(ast) {
38
- var astFragmentMap = {};
39
- var definitions = [];
40
-
41
- for (var i = 0; i < ast.definitions.length; i++) {
42
- var fragmentDefinition = ast.definitions[i];
43
-
44
- if (fragmentDefinition.kind === 'FragmentDefinition') {
45
- var fragmentName = fragmentDefinition.name.value;
46
- var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);
47
-
48
- // We know something about this fragment
49
- if (fragmentSourceMap.hasOwnProperty(fragmentName) && !fragmentSourceMap[fragmentName][sourceKey]) {
50
-
51
- // this is a problem because the app developer is trying to register another fragment with
52
- // the same name as one previously registered. So, we tell them about it.
53
- if (printFragmentWarnings) {
54
- console.warn("Warning: fragment with name " + fragmentName + " already exists.\n"
55
- + "graphql-tag enforces all fragment names across your application to be unique; read more about\n"
56
- + "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names");
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('graphql')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'graphql'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['graphql-tag'] = {}, global.tslib, global.graphql));
5
+ }(this, (function (exports, tslib, graphql) { 'use strict';
6
+
7
+ var docCache = new Map();
8
+ var fragmentSourceMap = new Map();
9
+ var printFragmentWarnings = true;
10
+ var experimentalFragmentVariables = false;
11
+ function normalize(string) {
12
+ return string.replace(/[\s,]+/g, ' ').trim();
13
+ }
14
+ function cacheKeyFromLoc(loc) {
15
+ return normalize(loc.source.body.substring(loc.start, loc.end));
16
+ }
17
+ function processFragments(ast) {
18
+ var seenKeys = new Set();
19
+ var definitions = [];
20
+ ast.definitions.forEach(function (fragmentDefinition) {
21
+ if (fragmentDefinition.kind === 'FragmentDefinition') {
22
+ var fragmentName = fragmentDefinition.name.value;
23
+ var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);
24
+ var sourceKeySet = fragmentSourceMap.get(fragmentName);
25
+ if (sourceKeySet && !sourceKeySet.has(sourceKey)) {
26
+ if (printFragmentWarnings) {
27
+ console.warn("Warning: fragment with name " + fragmentName + " already exists.\n"
28
+ + "graphql-tag enforces all fragment names across your application to be unique; read more about\n"
29
+ + "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names");
30
+ }
31
+ }
32
+ else if (!sourceKeySet) {
33
+ fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);
34
+ }
35
+ sourceKeySet.add(sourceKey);
36
+ if (!seenKeys.has(sourceKey)) {
37
+ seenKeys.add(sourceKey);
38
+ definitions.push(fragmentDefinition);
39
+ }
40
+ }
41
+ else {
42
+ definitions.push(fragmentDefinition);
43
+ }
44
+ });
45
+ return tslib.__assign(tslib.__assign({}, ast), { definitions: definitions });
46
+ }
47
+ function stripLoc(doc) {
48
+ var workSet = new Set(doc.definitions);
49
+ workSet.forEach(function (node) {
50
+ if (node.loc)
51
+ delete node.loc;
52
+ Object.keys(node).forEach(function (key) {
53
+ var value = node[key];
54
+ if (value && typeof value === 'object') {
55
+ workSet.add(value);
56
+ }
57
+ });
58
+ });
59
+ var loc = doc.loc;
60
+ if (loc) {
61
+ delete loc.startToken;
62
+ delete loc.endToken;
57
63
  }
58
-
59
- fragmentSourceMap[fragmentName][sourceKey] = true;
60
-
61
- } else if (!fragmentSourceMap.hasOwnProperty(fragmentName)) {
62
- fragmentSourceMap[fragmentName] = {};
63
- fragmentSourceMap[fragmentName][sourceKey] = true;
64
- }
65
-
66
- if (!astFragmentMap[sourceKey]) {
67
- astFragmentMap[sourceKey] = true;
68
- definitions.push(fragmentDefinition);
69
- }
70
- } else {
71
- definitions.push(fragmentDefinition);
64
+ return doc;
72
65
  }
73
- }
74
-
75
- ast.definitions = definitions;
76
- return ast;
77
- }
78
-
79
- function disableFragmentWarnings() {
80
- printFragmentWarnings = false;
81
- }
82
-
83
- function stripLoc(doc, removeLocAtThisLevel) {
84
- var docType = Object.prototype.toString.call(doc);
85
-
86
- if (docType === '[object Array]') {
87
- return doc.map(function (d) {
88
- return stripLoc(d, removeLocAtThisLevel);
89
- });
90
- }
91
-
92
- if (docType !== '[object Object]') {
93
- throw new Error('Unexpected input.');
94
- }
95
-
96
- // We don't want to remove the root loc field so we can use it
97
- // for fragment substitution (see below)
98
- if (removeLocAtThisLevel && doc.loc) {
99
- delete doc.loc;
100
- }
101
-
102
- // https://github.com/apollographql/graphql-tag/issues/40
103
- if (doc.loc) {
104
- delete doc.loc.startToken;
105
- delete doc.loc.endToken;
106
- }
107
-
108
- var keys = Object.keys(doc);
109
- var key;
110
- var value;
111
- var valueType;
112
-
113
- for (key in keys) {
114
- if (keys.hasOwnProperty(key)) {
115
- value = doc[keys[key]];
116
- valueType = Object.prototype.toString.call(value);
117
-
118
- if (valueType === '[object Object]' || valueType === '[object Array]') {
119
- doc[keys[key]] = stripLoc(value, true);
120
- }
66
+ function parseDocument(source) {
67
+ var cacheKey = normalize(source);
68
+ if (!docCache.has(cacheKey)) {
69
+ var parsed = graphql.parse(source, {
70
+ experimentalFragmentVariables: experimentalFragmentVariables
71
+ });
72
+ if (!parsed || parsed.kind !== 'Document') {
73
+ throw new Error('Not a valid GraphQL document.');
74
+ }
75
+ docCache.set(cacheKey, stripLoc(processFragments(parsed)));
76
+ }
77
+ return docCache.get(cacheKey);
121
78
  }
122
- }
123
-
124
- return doc;
125
- }
126
-
127
- var experimentalFragmentVariables = false;
128
- function parseDocument(doc) {
129
- var cacheKey = normalize(doc);
130
-
131
- if (docCache[cacheKey]) {
132
- return docCache[cacheKey];
133
- }
134
-
135
- var parsed = parse(doc, { experimentalFragmentVariables: experimentalFragmentVariables });
136
- if (!parsed || parsed.kind !== 'Document') {
137
- throw new Error('Not a valid GraphQL document.');
138
- }
139
-
140
- // check that all "new" fragments inside the documents are consistent with
141
- // existing fragments of the same name
142
- parsed = processFragments(parsed);
143
- parsed = stripLoc(parsed, false);
144
- docCache[cacheKey] = parsed;
145
-
146
- return parsed;
147
- }
148
-
149
- function enableExperimentalFragmentVariables() {
150
- experimentalFragmentVariables = true;
151
- }
152
-
153
- function disableExperimentalFragmentVariables() {
154
- experimentalFragmentVariables = false;
155
- }
156
-
157
- // XXX This should eventually disallow arbitrary string interpolation, like Relay does
158
- function gql(/* arguments */) {
159
- var args = Array.prototype.slice.call(arguments);
160
-
161
- var literals = args[0];
162
-
163
- // We always get literals[0] and then matching post literals for each arg given
164
- var result = (typeof(literals) === "string") ? literals : literals[0];
165
-
166
- for (var i = 1; i < args.length; i++) {
167
- if (args[i] && args[i].kind && args[i].kind === 'Document') {
168
- result += args[i].loc.source.body;
169
- } else {
170
- result += args[i];
79
+ function gql(literals) {
80
+ var args = [];
81
+ for (var _i = 1; _i < arguments.length; _i++) {
82
+ args[_i - 1] = arguments[_i];
83
+ }
84
+ if (typeof literals === 'string') {
85
+ literals = [literals];
86
+ }
87
+ var result = literals[0];
88
+ args.forEach(function (arg, i) {
89
+ if (arg && arg.kind === 'Document') {
90
+ result += arg.loc.source.body;
91
+ }
92
+ else {
93
+ result += arg;
94
+ }
95
+ result += literals[i + 1];
96
+ });
97
+ return parseDocument(result);
171
98
  }
99
+ function resetCaches() {
100
+ docCache.clear();
101
+ fragmentSourceMap.clear();
102
+ }
103
+ function disableFragmentWarnings() {
104
+ printFragmentWarnings = false;
105
+ }
106
+ function enableExperimentalFragmentVariables() {
107
+ experimentalFragmentVariables = true;
108
+ }
109
+ function disableExperimentalFragmentVariables() {
110
+ experimentalFragmentVariables = false;
111
+ }
112
+ var index = Object.assign(gql, {
113
+ gql: gql,
114
+ "default": gql,
115
+ resetCaches: resetCaches,
116
+ disableFragmentWarnings: disableFragmentWarnings,
117
+ enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,
118
+ disableExperimentalFragmentVariables: disableExperimentalFragmentVariables
119
+ });
172
120
 
173
- result += literals[i];
174
- }
175
-
176
- return parseDocument(result);
177
- }
178
-
179
- // Support typescript, which isn't as nice as Babel about default exports
180
- gql.default = gql;
181
- gql.resetCaches = resetCaches;
182
- gql.disableFragmentWarnings = disableFragmentWarnings;
183
- gql.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;
184
- gql.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;
121
+ exports.default = index;
122
+ exports.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;
123
+ exports.disableFragmentWarnings = disableFragmentWarnings;
124
+ exports.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;
125
+ exports.gql = gql;
126
+ exports.resetCaches = resetCaches;
185
127
 
186
- module.exports = gql;
128
+ Object.defineProperty(exports, '__esModule', { value: true });
187
129
 
188
130
  })));
189
131
  //# sourceMappingURL=graphql-tag.umd.js.map