graphql-tag 2.11.0 → 2.12.3
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 +15 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/lib/graphql-tag.umd.js +127 -181
- package/lib/graphql-tag.umd.js.map +1 -1
- package/lib/index.d.ts +15 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +120 -0
- package/lib/index.js.map +1 -0
- package/lib/tests.cjs.js +387 -0
- package/lib/tests.cjs.js.map +1 -0
- package/lib/tests.d.ts +2 -0
- package/lib/tests.d.ts.map +1 -0
- package/lib/tests.js +267 -0
- package/lib/tests.js.map +1 -0
- package/loader.js +1 -1
- package/main.js +3 -0
- package/package.json +36 -15
- package/CONTRIBUTING.md +0 -82
- package/index.d.ts +0 -20
- package/src/index.js +0 -180
- package/src/index.js.flow +0 -7
- package/test/graphql.js +0 -461
- package/test/mocha.opts +0 -1
package/lib/tests.js
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { __makeTemplateObject } from "tslib";
|
|
2
|
+
import 'source-map-support/register';
|
|
3
|
+
import { assert } from 'chai';
|
|
4
|
+
import gql from './index';
|
|
5
|
+
var loader = require('../loader');
|
|
6
|
+
describe('gql', function () {
|
|
7
|
+
it('parses queries', function () {
|
|
8
|
+
assert.equal(gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["{ testQuery }"], ["{ testQuery }"]))).kind, 'Document');
|
|
9
|
+
});
|
|
10
|
+
it('parses queries when called as a function', function () {
|
|
11
|
+
assert.equal(gql('{ testQuery }').kind, 'Document');
|
|
12
|
+
});
|
|
13
|
+
it('parses queries with weird substitutions', function () {
|
|
14
|
+
var obj = Object.create(null);
|
|
15
|
+
assert.equal(gql(templateObject_2 || (templateObject_2 = __makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), obj.missing).kind, 'Document');
|
|
16
|
+
assert.equal(gql(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), null).kind, 'Document');
|
|
17
|
+
assert.equal(gql(templateObject_4 || (templateObject_4 = __makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), 0).kind, 'Document');
|
|
18
|
+
});
|
|
19
|
+
it('allows interpolation of documents generated by the webpack loader', function () {
|
|
20
|
+
var sameFragment = "fragment SomeFragmentName on SomeType { someField }";
|
|
21
|
+
var jsSource = loader.call({ cacheable: function () { } }, sameFragment);
|
|
22
|
+
var module = { exports: Object.create(null) };
|
|
23
|
+
Function("module", jsSource)(module);
|
|
24
|
+
var document = gql(templateObject_5 || (templateObject_5 = __makeTemplateObject(["query { ...SomeFragmentName } ", ""], ["query { ...SomeFragmentName } ", ""])), module.exports);
|
|
25
|
+
assert.equal(document.kind, 'Document');
|
|
26
|
+
assert.equal(document.definitions.length, 2);
|
|
27
|
+
assert.equal(document.definitions[0].kind, 'OperationDefinition');
|
|
28
|
+
assert.equal(document.definitions[1].kind, 'FragmentDefinition');
|
|
29
|
+
});
|
|
30
|
+
it('parses queries through webpack loader', function () {
|
|
31
|
+
var jsSource = loader.call({ cacheable: function () { } }, '{ testQuery }');
|
|
32
|
+
var module = { exports: Object.create(null) };
|
|
33
|
+
Function("module", jsSource)(module);
|
|
34
|
+
assert.equal(module.exports.kind, 'Document');
|
|
35
|
+
});
|
|
36
|
+
it('parses single query through webpack loader', function () {
|
|
37
|
+
var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n ");
|
|
38
|
+
var module = { exports: Object.create(null) };
|
|
39
|
+
Function("module", jsSource)(module);
|
|
40
|
+
assert.equal(module.exports.kind, 'Document');
|
|
41
|
+
assert.exists(module.exports.Q1);
|
|
42
|
+
assert.equal(module.exports.Q1.kind, 'Document');
|
|
43
|
+
assert.equal(module.exports.Q1.definitions.length, 1);
|
|
44
|
+
});
|
|
45
|
+
it('parses single query and exports as default', function () {
|
|
46
|
+
var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n ");
|
|
47
|
+
var module = { exports: Object.create(null) };
|
|
48
|
+
Function("module", jsSource)(module);
|
|
49
|
+
assert.deepEqual(module.exports.definitions, module.exports.Q1.definitions);
|
|
50
|
+
});
|
|
51
|
+
it('parses multiple queries through webpack loader', function () {
|
|
52
|
+
var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n ");
|
|
53
|
+
var module = { exports: Object.create(null) };
|
|
54
|
+
Function("module", jsSource)(module);
|
|
55
|
+
assert.exists(module.exports.Q1);
|
|
56
|
+
assert.exists(module.exports.Q2);
|
|
57
|
+
assert.equal(module.exports.Q1.kind, 'Document');
|
|
58
|
+
assert.equal(module.exports.Q2.kind, 'Document');
|
|
59
|
+
assert.equal(module.exports.Q1.definitions.length, 1);
|
|
60
|
+
assert.equal(module.exports.Q2.definitions.length, 1);
|
|
61
|
+
});
|
|
62
|
+
it('parses fragments with variable definitions', function () {
|
|
63
|
+
gql.enableExperimentalFragmentVariables();
|
|
64
|
+
var parsed = gql(templateObject_6 || (templateObject_6 = __makeTemplateObject(["fragment A ($arg: String!) on Type { testQuery }"], ["fragment A ($arg: String!) on Type { testQuery }"])));
|
|
65
|
+
assert.equal(parsed.kind, 'Document');
|
|
66
|
+
assert.exists(parsed.definitions[0].variableDefinitions);
|
|
67
|
+
gql.disableExperimentalFragmentVariables();
|
|
68
|
+
});
|
|
69
|
+
it('does not nest queries needlessly in named exports', function () {
|
|
70
|
+
var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n query Q3 { test Query3 }\n ");
|
|
71
|
+
var module = { exports: Object.create(null) };
|
|
72
|
+
Function("module", jsSource)(module);
|
|
73
|
+
assert.notExists(module.exports.Q2.Q1);
|
|
74
|
+
assert.notExists(module.exports.Q3.Q1);
|
|
75
|
+
assert.notExists(module.exports.Q3.Q2);
|
|
76
|
+
});
|
|
77
|
+
it('tracks fragment dependencies from multiple queries through webpack loader', function () {
|
|
78
|
+
var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F1 on F { testQuery }\n fragment F2 on F { testQuery2 }\n fragment F3 on F { testQuery3 }\n query Q1 { ...F1 }\n query Q2 { ...F2 }\n query Q3 {\n ...F1\n ...F2\n }\n ");
|
|
79
|
+
var module = { exports: Object.create(null) };
|
|
80
|
+
Function("module", jsSource)(module);
|
|
81
|
+
assert.exists(module.exports.Q1);
|
|
82
|
+
assert.exists(module.exports.Q2);
|
|
83
|
+
assert.exists(module.exports.Q3);
|
|
84
|
+
var Q1 = module.exports.Q1.definitions;
|
|
85
|
+
var Q2 = module.exports.Q2.definitions;
|
|
86
|
+
var Q3 = module.exports.Q3.definitions;
|
|
87
|
+
assert.equal(Q1.length, 2);
|
|
88
|
+
assert.equal(Q1[0].name.value, 'Q1');
|
|
89
|
+
assert.equal(Q1[1].name.value, 'F1');
|
|
90
|
+
assert.equal(Q2.length, 2);
|
|
91
|
+
assert.equal(Q2[0].name.value, 'Q2');
|
|
92
|
+
assert.equal(Q2[1].name.value, 'F2');
|
|
93
|
+
assert.equal(Q3.length, 3);
|
|
94
|
+
assert.equal(Q3[0].name.value, 'Q3');
|
|
95
|
+
assert.equal(Q3[1].name.value, 'F1');
|
|
96
|
+
assert.equal(Q3[2].name.value, 'F2');
|
|
97
|
+
});
|
|
98
|
+
it('tracks fragment dependencies across nested fragments', function () {
|
|
99
|
+
var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F11 on F { testQuery }\n fragment F22 on F {\n ...F11\n testQuery2\n }\n fragment F33 on F {\n ...F22\n testQuery3\n }\n\n query Q1 {\n ...F33\n }\n\n query Q2 {\n id\n }\n ");
|
|
100
|
+
var module = { exports: Object.create(null) };
|
|
101
|
+
Function("module", jsSource)(module);
|
|
102
|
+
assert.exists(module.exports.Q1);
|
|
103
|
+
assert.exists(module.exports.Q2);
|
|
104
|
+
var Q1 = module.exports.Q1.definitions;
|
|
105
|
+
var Q2 = module.exports.Q2.definitions;
|
|
106
|
+
assert.equal(Q1.length, 4);
|
|
107
|
+
assert.equal(Q1[0].name.value, 'Q1');
|
|
108
|
+
assert.equal(Q1[1].name.value, 'F33');
|
|
109
|
+
assert.equal(Q1[2].name.value, 'F22');
|
|
110
|
+
assert.equal(Q1[3].name.value, 'F11');
|
|
111
|
+
assert.equal(Q2.length, 1);
|
|
112
|
+
});
|
|
113
|
+
it('correctly imports other files through the webpack loader', function () {
|
|
114
|
+
var query = "#import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }";
|
|
115
|
+
var jsSource = loader.call({ cacheable: function () { } }, query);
|
|
116
|
+
var module = { exports: Object.create(null) };
|
|
117
|
+
var require = function (path) {
|
|
118
|
+
assert.equal(path, './fragment_definition.graphql');
|
|
119
|
+
return gql(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n fragment authorDetails on Author {\n firstName\n lastName\n }"], ["\n fragment authorDetails on Author {\n firstName\n lastName\n }"])));
|
|
120
|
+
};
|
|
121
|
+
Function("module,require", jsSource)(module, require);
|
|
122
|
+
assert.equal(module.exports.kind, 'Document');
|
|
123
|
+
var definitions = module.exports.definitions;
|
|
124
|
+
assert.equal(definitions.length, 2);
|
|
125
|
+
assert.equal(definitions[0].kind, 'OperationDefinition');
|
|
126
|
+
assert.equal(definitions[1].kind, 'FragmentDefinition');
|
|
127
|
+
});
|
|
128
|
+
it('tracks fragment dependencies across fragments loaded via the webpack loader', function () {
|
|
129
|
+
var query = "#import \"./fragment_definition.graphql\"\n fragment F111 on F {\n ...F222\n }\n\n query Q1 {\n ...F111\n }\n\n query Q2 {\n a\n }\n ";
|
|
130
|
+
var jsSource = loader.call({ cacheable: function () { } }, query);
|
|
131
|
+
var module = { exports: Object.create(null) };
|
|
132
|
+
var require = function (path) {
|
|
133
|
+
assert.equal(path, './fragment_definition.graphql');
|
|
134
|
+
return gql(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n fragment F222 on F {\n f1\n f2\n }"], ["\n fragment F222 on F {\n f1\n f2\n }"])));
|
|
135
|
+
};
|
|
136
|
+
Function("module,require", jsSource)(module, require);
|
|
137
|
+
assert.exists(module.exports.Q1);
|
|
138
|
+
assert.exists(module.exports.Q2);
|
|
139
|
+
var Q1 = module.exports.Q1.definitions;
|
|
140
|
+
var Q2 = module.exports.Q2.definitions;
|
|
141
|
+
assert.equal(Q1.length, 3);
|
|
142
|
+
assert.equal(Q1[0].name.value, 'Q1');
|
|
143
|
+
assert.equal(Q1[1].name.value, 'F111');
|
|
144
|
+
assert.equal(Q1[2].name.value, 'F222');
|
|
145
|
+
assert.equal(Q2.length, 1);
|
|
146
|
+
});
|
|
147
|
+
it('does not complain when presented with normal comments', function (done) {
|
|
148
|
+
assert.doesNotThrow(function () {
|
|
149
|
+
var query = "#normal comment\n query {\n author {\n ...authorDetails\n }\n }";
|
|
150
|
+
var jsSource = loader.call({ cacheable: function () { } }, query);
|
|
151
|
+
var module = { exports: Object.create(null) };
|
|
152
|
+
Function("module", jsSource)(module);
|
|
153
|
+
assert.equal(module.exports.kind, 'Document');
|
|
154
|
+
done();
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
it('returns the same object for the same query', function () {
|
|
158
|
+
assert.isTrue(gql(templateObject_9 || (templateObject_9 = __makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql(templateObject_10 || (templateObject_10 = __makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))));
|
|
159
|
+
});
|
|
160
|
+
it('returns the same object for the same query, even with whitespace differences', function () {
|
|
161
|
+
assert.isTrue(gql(templateObject_11 || (templateObject_11 = __makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql(templateObject_12 || (templateObject_12 = __makeTemplateObject([" { sameQuery, }"], [" { sameQuery, }"]))));
|
|
162
|
+
});
|
|
163
|
+
var fragmentAst = gql(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"], ["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"])));
|
|
164
|
+
it('returns the same object for the same fragment', function () {
|
|
165
|
+
assert.isTrue(gql(templateObject_14 || (templateObject_14 = __makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"]))) === gql(templateObject_15 || (templateObject_15 = __makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"]))));
|
|
166
|
+
});
|
|
167
|
+
it('returns the same object for the same document with substitution', function () {
|
|
168
|
+
assert.isTrue(gql(templateObject_16 || (templateObject_16 = __makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst) === gql(templateObject_17 || (templateObject_17 = __makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst));
|
|
169
|
+
});
|
|
170
|
+
it('can reference a fragment that references as fragment', function () {
|
|
171
|
+
var secondFragmentAst = gql(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "], ["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "])), fragmentAst);
|
|
172
|
+
var ast = gql(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "])), secondFragmentAst);
|
|
173
|
+
assert.deepEqual(ast, gql(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "]))));
|
|
174
|
+
});
|
|
175
|
+
describe('fragment warnings', function () {
|
|
176
|
+
var warnings = [];
|
|
177
|
+
var oldConsoleWarn = console.warn;
|
|
178
|
+
beforeEach(function () {
|
|
179
|
+
gql.resetCaches();
|
|
180
|
+
warnings = [];
|
|
181
|
+
console.warn = function (w) { return warnings.push(w); };
|
|
182
|
+
});
|
|
183
|
+
afterEach(function () {
|
|
184
|
+
console.warn = oldConsoleWarn;
|
|
185
|
+
});
|
|
186
|
+
it('warns if you use the same fragment name for different fragments', function () {
|
|
187
|
+
var frag1 = gql(templateObject_21 || (templateObject_21 = __makeTemplateObject(["fragment TestSame on Bar { fieldOne }"], ["fragment TestSame on Bar { fieldOne }"])));
|
|
188
|
+
var frag2 = gql(templateObject_22 || (templateObject_22 = __makeTemplateObject(["fragment TestSame on Bar { fieldTwo }"], ["fragment TestSame on Bar { fieldTwo }"])));
|
|
189
|
+
assert.isFalse(frag1 === frag2);
|
|
190
|
+
assert.equal(warnings.length, 1);
|
|
191
|
+
});
|
|
192
|
+
it('does not warn if you use the same fragment name for the same fragment', function () {
|
|
193
|
+
var frag1 = gql(templateObject_23 || (templateObject_23 = __makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["fragment TestDifferent on Bar { fieldOne }"])));
|
|
194
|
+
var frag2 = gql(templateObject_24 || (templateObject_24 = __makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["fragment TestDifferent on Bar { fieldOne }"])));
|
|
195
|
+
assert.isTrue(frag1 === frag2);
|
|
196
|
+
assert.equal(warnings.length, 0);
|
|
197
|
+
});
|
|
198
|
+
it('does not warn if you use the same embedded fragment in two different queries', function () {
|
|
199
|
+
var frag1 = gql(templateObject_25 || (templateObject_25 = __makeTemplateObject(["fragment TestEmbedded on Bar { field }"], ["fragment TestEmbedded on Bar { field }"])));
|
|
200
|
+
var query1 = gql(templateObject_26 || (templateObject_26 = __makeTemplateObject(["{ bar { fieldOne ...TestEmbedded } } ", ""], ["{ bar { fieldOne ...TestEmbedded } } ", ""])), frag1);
|
|
201
|
+
var query2 = gql(templateObject_27 || (templateObject_27 = __makeTemplateObject(["{ bar { fieldTwo ...TestEmbedded } } ", ""], ["{ bar { fieldTwo ...TestEmbedded } } ", ""])), frag1);
|
|
202
|
+
assert.isFalse(query1 === query2);
|
|
203
|
+
assert.equal(warnings.length, 0);
|
|
204
|
+
});
|
|
205
|
+
it('does not warn if you use the same fragment name for embedded and non-embedded fragments', function () {
|
|
206
|
+
var frag1 = gql(templateObject_28 || (templateObject_28 = __makeTemplateObject(["fragment TestEmbeddedTwo on Bar { field }"], ["fragment TestEmbeddedTwo on Bar { field }"])));
|
|
207
|
+
gql(templateObject_29 || (templateObject_29 = __makeTemplateObject(["{ bar { ...TestEmbedded } } ", ""], ["{ bar { ...TestEmbedded } } ", ""])), frag1);
|
|
208
|
+
gql(templateObject_30 || (templateObject_30 = __makeTemplateObject(["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"], ["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"])));
|
|
209
|
+
assert.equal(warnings.length, 0);
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
describe('unique fragments', function () {
|
|
213
|
+
beforeEach(function () {
|
|
214
|
+
gql.resetCaches();
|
|
215
|
+
});
|
|
216
|
+
it('strips duplicate fragments from the document', function () {
|
|
217
|
+
var frag1 = gql(templateObject_31 || (templateObject_31 = __makeTemplateObject(["fragment TestDuplicate on Bar { field }"], ["fragment TestDuplicate on Bar { field }"])));
|
|
218
|
+
var query1 = gql(templateObject_32 || (templateObject_32 = __makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", " ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", " ", ""])), frag1, frag1);
|
|
219
|
+
var query2 = gql(templateObject_33 || (templateObject_33 = __makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", ""])), frag1);
|
|
220
|
+
assert.equal(query1.definitions.length, 2);
|
|
221
|
+
assert.equal(query1.definitions[1].kind, 'FragmentDefinition');
|
|
222
|
+
assert.deepEqual(query1.definitions, query2.definitions);
|
|
223
|
+
});
|
|
224
|
+
it('ignores duplicate fragments from second-level imports when using the webpack loader', function () {
|
|
225
|
+
var load = function (require, query) {
|
|
226
|
+
var jsSource = loader.call({ cacheable: function () { } }, query);
|
|
227
|
+
var module = { exports: Object.create(null) };
|
|
228
|
+
Function("require,module", jsSource)(require, module);
|
|
229
|
+
return module.exports;
|
|
230
|
+
};
|
|
231
|
+
var test_require = function (path) {
|
|
232
|
+
switch (path) {
|
|
233
|
+
case './friends.graphql':
|
|
234
|
+
return load(test_require, [
|
|
235
|
+
'#import "./person.graphql"',
|
|
236
|
+
'fragment friends on Hero { friends { ...person } }',
|
|
237
|
+
].join('\n'));
|
|
238
|
+
case './enemies.graphql':
|
|
239
|
+
return load(test_require, [
|
|
240
|
+
'#import "./person.graphql"',
|
|
241
|
+
'fragment enemies on Hero { enemies { ...person } }',
|
|
242
|
+
].join('\n'));
|
|
243
|
+
case './person.graphql':
|
|
244
|
+
return load(test_require, 'fragment person on Person { name }\n');
|
|
245
|
+
default:
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
;
|
|
249
|
+
};
|
|
250
|
+
var result = load(test_require, [
|
|
251
|
+
'#import "./friends.graphql"',
|
|
252
|
+
'#import "./enemies.graphql"',
|
|
253
|
+
'query { hero { ...friends ...enemies } }',
|
|
254
|
+
].join('\n'));
|
|
255
|
+
assert.equal(result.kind, 'Document');
|
|
256
|
+
assert.equal(result.definitions.length, 4, 'after deduplication, only 4 fragments should remain');
|
|
257
|
+
assert.equal(result.definitions[0].kind, 'OperationDefinition');
|
|
258
|
+
var fragments = result.definitions.slice(1);
|
|
259
|
+
assert(fragments.every(function (fragment) { return fragment.kind === 'FragmentDefinition'; }));
|
|
260
|
+
assert(fragments.some(function (fragment) { return fragment.name.value === 'friends'; }));
|
|
261
|
+
assert(fragments.some(function (fragment) { return fragment.name.value === 'enemies'; }));
|
|
262
|
+
assert(fragments.some(function (fragment) { return fragment.name.value === 'person'; }));
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33;
|
|
267
|
+
//# sourceMappingURL=tests.js.map
|
package/lib/tests.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tests.js","sourceRoot":"","sources":["../src/tests.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG9B,OAAO,GAAG,MAAM,SAAS,CAAC;AAC1B,IAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEpC,QAAQ,CAAC,KAAK,EAAE;IACd,EAAE,CAAC,gBAAgB,EAAE;QACnB,MAAM,CAAC,KAAK,CAAC,GAAG,kFAAA,eAAe,KAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE;QAC5C,IAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,GAAG,+FAAA,mBAAmB,EAAW,OAAM,KAAjB,GAAG,CAAC,OAAO,EAAO,IAAI,EAAE,U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AC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;YAIhE,IAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAA6B,CAAC;YAC1E,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,KAAK,oBAAoB,EAAtC,CAAsC,CAAC,CAAC,CAAA;YAC3E,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,EAAjC,CAAiC,CAAC,CAAC,CAAA;YACrE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,EAAjC,CAAiC,CAAC,CAAC,CAAA;YACrE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAhC,CAAgC,CAAC,CAAC,CAAA;QACtE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AAwBL,CAAC,CAAC,CAAC"}
|
package/loader.js
CHANGED
package/main.js
ADDED
package/package.json
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphql-tag",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.3",
|
|
4
4
|
"description": "A JavaScript template literal tag that parses GraphQL queries",
|
|
5
|
-
"main": "./
|
|
6
|
-
"module": "./
|
|
7
|
-
"jsnext:main": "./
|
|
5
|
+
"main": "./main.js",
|
|
6
|
+
"module": "./lib/index.js",
|
|
7
|
+
"jsnext:main": "./lib/index.js",
|
|
8
|
+
"types": "./lib/index.d.ts",
|
|
8
9
|
"sideEffects": false,
|
|
9
10
|
"scripts": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"prebuild": "rimraf lib",
|
|
12
|
+
"build": "tsc && rollup -c && npm run flow",
|
|
13
|
+
"flow": "cp src/index.js.flow lib/graphql-tag.umd.js.flow",
|
|
14
|
+
"test": "npm run test:ts3 && npm run test:ts4",
|
|
15
|
+
"test:ts3": "npm i typescript@3.7.x && npm run test:mocha",
|
|
16
|
+
"test:ts4": "npm i typescript@4.x && npm run test:mocha",
|
|
17
|
+
"test:mocha": "npm run build && mocha lib/tests.cjs.js",
|
|
18
|
+
"prepublish": "npm run build"
|
|
13
19
|
},
|
|
20
|
+
"files": [
|
|
21
|
+
"lib/",
|
|
22
|
+
"loader.js",
|
|
23
|
+
"main.js"
|
|
24
|
+
],
|
|
14
25
|
"repository": {
|
|
15
26
|
"type": "git",
|
|
16
27
|
"url": "git+https://github.com/apollographql/graphql-tag.git"
|
|
@@ -21,17 +32,27 @@
|
|
|
21
32
|
"url": "https://github.com/apollographql/graphql-tag/issues"
|
|
22
33
|
},
|
|
23
34
|
"homepage": "https://github.com/apollographql/graphql-tag#readme",
|
|
24
|
-
"dependencies": {
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"tslib": "^2.1.0"
|
|
37
|
+
},
|
|
25
38
|
"devDependencies": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
39
|
+
"@types/chai": "^4.2.14",
|
|
40
|
+
"@types/mocha": "^8.2.0",
|
|
41
|
+
"@types/node": "^14.14.22",
|
|
42
|
+
"chai": "^4.2.0",
|
|
43
|
+
"graphql": "^15.4.0",
|
|
44
|
+
"mocha": "^8.2.1",
|
|
45
|
+
"rimraf": "^3.0.2",
|
|
46
|
+
"rollup": "^2.33.1",
|
|
47
|
+
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
48
|
+
"source-map-support": "^0.5.19",
|
|
49
|
+
"test-all-versions": "^5.0.1",
|
|
50
|
+
"typescript": "^4.1.3"
|
|
33
51
|
},
|
|
34
52
|
"peerDependencies": {
|
|
35
53
|
"graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=10"
|
|
36
57
|
}
|
|
37
58
|
}
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# Apollo Contributor Guide
|
|
2
|
-
|
|
3
|
-
Excited about Apollo and want to make it better? We’re excited too!
|
|
4
|
-
|
|
5
|
-
Apollo is a community of developers just like you, striving to create the best tools and libraries around GraphQL. We welcome anyone who wants to contribute or provide constructive feedback, no matter the age or level of experience. If you want to help but don't know where to start, let us know, and we'll find something for you.
|
|
6
|
-
|
|
7
|
-
Oh, and if you haven't already, sign up for the [Apollo Slack](http://www.apollodata.com/#slack).
|
|
8
|
-
|
|
9
|
-
Here are some ways to contribute to the project, from easiest to most difficult:
|
|
10
|
-
|
|
11
|
-
* [Reporting bugs](#reporting-bugs)
|
|
12
|
-
* [Improving the documentation](#improving-the-documentation)
|
|
13
|
-
* [Responding to issues](#responding-to-issues)
|
|
14
|
-
* [Small bug fixes](#small-bug-fixes)
|
|
15
|
-
* [Suggesting features](#suggesting-features)
|
|
16
|
-
* [Big pull requests](#big-prs)
|
|
17
|
-
|
|
18
|
-
## Issues
|
|
19
|
-
|
|
20
|
-
### Reporting bugs
|
|
21
|
-
|
|
22
|
-
If you encounter a bug, please file an issue on GitHub via the repository of the sub-project you think contains the bug. If an issue you have is already reported, please add additional information or add a 👍 reaction to indicate your agreement.
|
|
23
|
-
|
|
24
|
-
While we will try to be as helpful as we can on any issue reported, please include the following to maximize the chances of a quick fix:
|
|
25
|
-
|
|
26
|
-
1. **Intended outcome:** What you were trying to accomplish when the bug occurred, and as much code as possible related to the source of the problem.
|
|
27
|
-
2. **Actual outcome:** A description of what actually happened, including a screenshot or copy-paste of any related error messages, logs, or other output that might be related. Places to look for information include your browser console, server console, and network logs. Please avoid non-specific phrases like “didn’t work” or “broke”.
|
|
28
|
-
3. **How to reproduce the issue:** Instructions for how the issue can be reproduced by a maintainer or contributor. Be as specific as possible, and only mention what is necessary to reproduce the bug. If possible, try to isolate the exact circumstances in which the bug occurs and avoid speculation over what the cause might be.
|
|
29
|
-
|
|
30
|
-
Creating a good reproduction really helps contributors investigate and resolve your issue quickly. In many cases, the act of creating a minimal reproduction illuminates that the source of the bug was somewhere outside the library in question, saving time and effort for everyone.
|
|
31
|
-
|
|
32
|
-
### Improving the documentation
|
|
33
|
-
|
|
34
|
-
Improving the documentation, examples, and other open source content can be the easiest way to contribute to the library. If you see a piece of content that can be better, open a PR with an improvement, no matter how small! If you would like to suggest a big change or major rewrite, we’d love to hear your ideas but please open an issue for discussion before writing the PR.
|
|
35
|
-
|
|
36
|
-
### Responding to issues
|
|
37
|
-
|
|
38
|
-
In addition to reporting issues, a great way to contribute to Apollo is to respond to other peoples' issues and try to identify the problem or help them work around it. If you’re interested in taking a more active role in this process, please go ahead and respond to issues. And don't forget to say "Hi" on Apollo Slack!
|
|
39
|
-
|
|
40
|
-
### Small bug fixes
|
|
41
|
-
|
|
42
|
-
For a small bug fix change (less than 20 lines of code changed), feel free to open a pull request. We’ll try to merge it as fast as possible and ideally publish a new release on the same day. The only requirement is, make sure you also add a test that verifies the bug you are trying to fix.
|
|
43
|
-
|
|
44
|
-
### Suggesting features
|
|
45
|
-
|
|
46
|
-
Most of the features in Apollo came from suggestions by you, the community! We welcome any ideas about how to make Apollo better for your use case. Unless there is overwhelming demand for a feature, it might not get implemented immediately, but please include as much information as possible that will help people have a discussion about your proposal:
|
|
47
|
-
|
|
48
|
-
1. **Use case:** What are you trying to accomplish, in specific terms? Often, there might already be a good way to do what you need and a new feature is unnecessary, but it’s hard to know without information about the specific use case.
|
|
49
|
-
2. **Could this be a plugin?** In many cases, a feature might be too niche to be included in the core of a library, and is better implemented as a companion package. If there isn’t a way to extend the library to do what you want, could we add additional plugin APIs? It’s important to make the case for why a feature should be part of the core functionality of the library.
|
|
50
|
-
3. **Is there a workaround?** Is this a more convenient way to do something that is already possible, or is there some blocker that makes a workaround unfeasible?
|
|
51
|
-
|
|
52
|
-
Feature requests will be labeled as such, and we encourage using GitHub issues as a place to discuss new features and possible implementation designs. Please refrain from submitting a pull request to implement a proposed feature until there is consensus that it should be included. This way, you can avoid putting in work that can’t be merged in.
|
|
53
|
-
|
|
54
|
-
Once there is a consensus on the need for a new feature, proceed as listed below under “Big PRs”.
|
|
55
|
-
|
|
56
|
-
## Big PRs
|
|
57
|
-
|
|
58
|
-
This includes:
|
|
59
|
-
|
|
60
|
-
- Big bug fixes
|
|
61
|
-
- New features
|
|
62
|
-
|
|
63
|
-
For significant changes to a repository, it’s important to settle on a design before starting on the implementation. This way, we can make sure that major improvements get the care and attention they deserve. Since big changes can be risky and might not always get merged, it’s good to reduce the amount of possible wasted effort by agreeing on an implementation design/plan first.
|
|
64
|
-
|
|
65
|
-
1. **Open an issue.** Open an issue about your bug or feature, as described above.
|
|
66
|
-
2. **Reach consensus.** Some contributors and community members should reach an agreement that this feature or bug is important, and that someone should work on implementing or fixing it.
|
|
67
|
-
3. **Agree on intended behavior.** On the issue, reach an agreement about the desired behavior. In the case of a bug fix, it should be clear what it means for the bug to be fixed, and in the case of a feature, it should be clear what it will be like for developers to use the new feature.
|
|
68
|
-
4. **Agree on implementation plan.** Write a plan for how this feature or bug fix should be implemented. What modules need to be added or rewritten? Should this be one pull request or multiple incremental improvements? Who is going to do each part?
|
|
69
|
-
5. **Submit PR.** In the case where multiple dependent patches need to be made to implement the change, only submit one at a time. Otherwise, the others might get stale while the first is reviewed and merged. Make sure to avoid “while we’re here” type changes - if something isn’t relevant to the improvement at hand, it should be in a separate PR; this especially includes code style changes of unrelated code.
|
|
70
|
-
6. **Review.** At least one core contributor should sign off on the change before it’s merged. Look at the “code review” section below to learn about factors are important in the code review. If you want to expedite the code being merged, try to review your own code first!
|
|
71
|
-
7. **Merge and release!**
|
|
72
|
-
|
|
73
|
-
### Code review guidelines
|
|
74
|
-
|
|
75
|
-
It’s important that every piece of code in Apollo packages is reviewed by at least one core contributor familiar with that codebase. Here are some things we look for:
|
|
76
|
-
|
|
77
|
-
1. **Required CI checks pass.** This is a prerequisite for the review, and it is the PR author's responsibility. As long as the tests don’t pass, the PR won't get reviewed.
|
|
78
|
-
2. **Simplicity.** Is this the simplest way to achieve the intended goal? If there are too many files, redundant functions, or complex lines of code, suggest a simpler way to do the same thing. In particular, avoid implementing an overly general solution when a simple, small, and pragmatic fix will do.
|
|
79
|
-
3. **Testing.** Do the tests ensure this code won’t break when other stuff changes around it? When it does break, will the tests added help us identify which part of the library has the problem? Did we cover an appropriate set of edge cases? Look at the test coverage report if there is one. Are all significant code paths in the new code exercised at least once?
|
|
80
|
-
4. **No unnecessary or unrelated changes.** PRs shouldn’t come with random formatting changes, especially in unrelated parts of the code. If there is some refactoring that needs to be done, it should be in a separate PR from a bug fix or feature, if possible.
|
|
81
|
-
5. **Code has appropriate comments.** Code should be commented, or written in a clear “self-documenting” way.
|
|
82
|
-
6. **Idiomatic use of the language.** In TypeScript, make sure the typings are specific and correct. In ES2015, make sure to use imports rather than require and const instead of var, etc. Ideally a linter enforces a lot of this, but use your common sense and follow the style of the surrounding code.
|
package/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
declare module "graphql-tag" {
|
|
2
|
-
function gql(
|
|
3
|
-
literals: ReadonlyArray<string> | Readonly<string>,
|
|
4
|
-
...placeholders: any[]
|
|
5
|
-
): import("graphql").DocumentNode;
|
|
6
|
-
|
|
7
|
-
namespace gql {
|
|
8
|
-
function resetCaches(): void;
|
|
9
|
-
function disableFragmentWarnings(): void;
|
|
10
|
-
function enableExperimentalFragmentVariables(): void;
|
|
11
|
-
function disableExperimentalFragmentVariables(): void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default gql;
|
|
15
|
-
|
|
16
|
-
export function resetCaches(): void;
|
|
17
|
-
export function disableFragmentWarnings(): void;
|
|
18
|
-
export function enableExperimentalFragmentVariables(): void;
|
|
19
|
-
export function disableExperimentalFragmentVariables(): void;
|
|
20
|
-
}
|