@apollo/client 3.9.0-alpha.0 → 3.9.0-alpha.2
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/apollo-client.cjs +116 -136
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +6 -29
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +6 -29
- package/cache/index.d.ts +1 -2
- package/cache/index.d.ts.map +1 -1
- package/cache/index.js +1 -2
- package/cache/index.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +1 -2
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/object-canon.d.ts +0 -5
- package/cache/inmemory/object-canon.d.ts.map +1 -1
- package/cache/inmemory/object-canon.js +0 -22
- package/cache/inmemory/object-canon.js.map +1 -1
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +0 -2
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +1 -2
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +5 -6
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +0 -2
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +0 -2
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +2 -2
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +8 -11
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +8 -11
- package/dev/dev.cjs +52 -37
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +52 -37
- package/dev/loadErrorMessageHandler.js +1 -1
- package/dev/loadErrorMessageHandler.js.map +1 -1
- package/invariantErrorCodes.js +24 -18
- package/package.json +7 -7
- package/react/cache/index.d.ts +0 -4
- package/react/cache/index.d.ts.map +1 -1
- package/react/cache/index.js +0 -14
- package/react/cache/index.js.map +1 -1
- package/react/index.d.ts +0 -1
- package/react/index.d.ts.map +1 -1
- package/react/index.js +0 -1
- package/react/index.js.map +1 -1
- package/react/react.cjs +1 -218
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +1 -218
- package/react/types/types.d.ts +0 -3
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +9 -1
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +9 -1
- package/testing/core/mocking/mockLink.d.ts +1 -0
- package/testing/core/mocking/mockLink.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +9 -1
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/internal/ObservableStream.d.ts +26 -0
- package/testing/internal/ObservableStream.d.ts.map +1 -0
- package/testing/internal/ObservableStream.js +101 -0
- package/testing/internal/ObservableStream.js.map +1 -0
- package/testing/internal/index.d.ts +1 -0
- package/testing/internal/index.d.ts.map +1 -1
- package/testing/internal/index.js +1 -0
- package/testing/internal/index.js.map +1 -1
- package/utilities/common/canonicalStringify.d.ts +4 -0
- package/utilities/common/canonicalStringify.d.ts.map +1 -0
- package/utilities/common/canonicalStringify.js +37 -0
- package/utilities/common/canonicalStringify.js.map +1 -0
- package/utilities/globals/globals.cjs +29 -19
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +29 -19
- package/utilities/globals/invariantWrappers.d.ts.map +1 -1
- package/utilities/globals/invariantWrappers.js +28 -18
- package/utilities/globals/invariantWrappers.js.map +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +4 -4
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.d.ts +2 -2
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +8 -20
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/index.d.ts +1 -0
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +1 -0
- package/utilities/index.js.map +1 -1
- package/utilities/observables/asyncMap.d.ts.map +1 -1
- package/utilities/observables/asyncMap.js +17 -34
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/utilities.cjs +80 -72
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +80 -72
- package/version.js +1 -1
package/dev/dev.cjs.native.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var globals = require('../utilities/globals');
|
|
6
|
-
var tslib = require('tslib');
|
|
7
6
|
var tsInvariant = require('ts-invariant');
|
|
8
7
|
|
|
9
8
|
const errorCodes = // This file is used by the error message display website and the
|
|
@@ -288,101 +287,107 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
288
287
|
},
|
|
289
288
|
|
|
290
289
|
63: {
|
|
290
|
+
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
291
|
+
condition: "mockedResponse.maxUsageCount > 0",
|
|
292
|
+
message: "Mock response maxUsageCount must be greater than 0, %s given"
|
|
293
|
+
},
|
|
294
|
+
|
|
295
|
+
64: {
|
|
291
296
|
file: "@apollo/client/utilities/graphql/DocumentTransform.js",
|
|
292
297
|
condition: "Array.isArray(cacheKeys)",
|
|
293
298
|
message: "`getCacheKey` must return an array or undefined"
|
|
294
299
|
},
|
|
295
300
|
|
|
296
|
-
|
|
301
|
+
65: {
|
|
297
302
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
298
303
|
condition: "evaledValue !== void 0",
|
|
299
304
|
message: "Invalid variable referenced in @%s directive."
|
|
300
305
|
},
|
|
301
306
|
|
|
302
|
-
|
|
307
|
+
66: {
|
|
303
308
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
304
309
|
condition: "directiveArguments && directiveArguments.length === 1",
|
|
305
310
|
message: "Incorrect number of arguments for the @%s directive."
|
|
306
311
|
},
|
|
307
312
|
|
|
308
|
-
|
|
313
|
+
67: {
|
|
309
314
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
310
315
|
condition: "ifArgument.name && ifArgument.name.value === \"if\"",
|
|
311
316
|
message: "Invalid argument for the @%s directive."
|
|
312
317
|
},
|
|
313
318
|
|
|
314
|
-
|
|
319
|
+
68: {
|
|
315
320
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
316
321
|
condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
|
|
317
322
|
message: "Argument for the @%s directive must be a variable or a boolean value."
|
|
318
323
|
},
|
|
319
324
|
|
|
320
|
-
|
|
325
|
+
69: {
|
|
321
326
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
322
327
|
|
|
323
328
|
message: "Found a %s operation%s. " +
|
|
324
329
|
"No operations are allowed when using a fragment as a query. Only fragments are allowed."
|
|
325
330
|
},
|
|
326
331
|
|
|
327
|
-
|
|
332
|
+
70: {
|
|
328
333
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
329
334
|
condition: "fragments.length === 1",
|
|
330
335
|
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
331
336
|
},
|
|
332
337
|
|
|
333
|
-
|
|
338
|
+
71: {
|
|
334
339
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
335
340
|
condition: "fragment",
|
|
336
341
|
message: "No fragment named %s"
|
|
337
342
|
},
|
|
338
343
|
|
|
339
|
-
|
|
344
|
+
72: {
|
|
340
345
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
341
346
|
condition: "doc && doc.kind === \"Document\"",
|
|
342
347
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
343
348
|
},
|
|
344
349
|
|
|
345
|
-
|
|
350
|
+
73: {
|
|
346
351
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
347
352
|
message: "Schema type definitions not allowed in queries. Found: \"%s\""
|
|
348
353
|
},
|
|
349
354
|
|
|
350
|
-
|
|
355
|
+
74: {
|
|
351
356
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
352
357
|
condition: "operations.length <= 1",
|
|
353
358
|
message: "Ambiguous GraphQL document: contains %s operations"
|
|
354
359
|
},
|
|
355
360
|
|
|
356
|
-
|
|
361
|
+
75: {
|
|
357
362
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
358
363
|
condition: "queryDef && queryDef.operation === \"query\"",
|
|
359
364
|
message: "Must contain a query definition."
|
|
360
365
|
},
|
|
361
366
|
|
|
362
|
-
|
|
367
|
+
76: {
|
|
363
368
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
364
369
|
condition: "doc.kind === \"Document\"",
|
|
365
370
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
366
371
|
},
|
|
367
372
|
|
|
368
|
-
|
|
373
|
+
77: {
|
|
369
374
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
370
375
|
condition: "doc.definitions.length <= 1",
|
|
371
376
|
message: "Fragment must have exactly one definition."
|
|
372
377
|
},
|
|
373
378
|
|
|
374
|
-
|
|
379
|
+
78: {
|
|
375
380
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
376
381
|
condition: "fragmentDef.kind === \"FragmentDefinition\"",
|
|
377
382
|
message: "Must be a fragment definition."
|
|
378
383
|
},
|
|
379
384
|
|
|
380
|
-
|
|
385
|
+
79: {
|
|
381
386
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
382
387
|
message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
|
|
383
388
|
},
|
|
384
389
|
|
|
385
|
-
|
|
390
|
+
80: {
|
|
386
391
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
387
392
|
|
|
388
393
|
message: "The inline argument \"%s\" of kind \"%s\"" +
|
|
@@ -481,7 +486,7 @@ const devWarn = {
|
|
|
481
486
|
message: "Using `returnPartialData` with a `no-cache` fetch policy has no effect. To read partial data from the cache, consider using an alternate fetch policy."
|
|
482
487
|
},
|
|
483
488
|
|
|
484
|
-
|
|
489
|
+
82: {
|
|
485
490
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
486
491
|
|
|
487
492
|
message: "Removing an @connection directive even though it does not have a key. " +
|
|
@@ -510,13 +515,13 @@ const devError = {
|
|
|
510
515
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
511
516
|
},
|
|
512
517
|
|
|
513
|
-
|
|
518
|
+
81: {
|
|
514
519
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
515
520
|
message: "Could not find operation or fragment"
|
|
516
521
|
}
|
|
517
522
|
};
|
|
518
523
|
|
|
519
|
-
var version = "3.9.0-alpha.
|
|
524
|
+
var version = "3.9.0-alpha.2";
|
|
520
525
|
|
|
521
526
|
function maybe(thunk) {
|
|
522
527
|
try {
|
|
@@ -556,11 +561,14 @@ function wrap(fn) {
|
|
|
556
561
|
args[_i - 1] = arguments[_i];
|
|
557
562
|
}
|
|
558
563
|
if (typeof message === "number") {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
564
|
+
var arg0 = message;
|
|
565
|
+
message = getHandledErrorMsg(arg0);
|
|
566
|
+
if (!message) {
|
|
567
|
+
message = getFallbackErrorMsg(arg0, args);
|
|
568
|
+
args = [];
|
|
569
|
+
}
|
|
563
570
|
}
|
|
571
|
+
fn.apply(void 0, [message].concat(args));
|
|
564
572
|
};
|
|
565
573
|
}
|
|
566
574
|
Object.assign(function invariant(condition, message) {
|
|
@@ -569,7 +577,7 @@ Object.assign(function invariant(condition, message) {
|
|
|
569
577
|
args[_i - 2] = arguments[_i];
|
|
570
578
|
}
|
|
571
579
|
if (!condition) {
|
|
572
|
-
tsInvariant.invariant(condition,
|
|
580
|
+
tsInvariant.invariant(condition, getHandledErrorMsg(message, args) || getFallbackErrorMsg(message, args));
|
|
573
581
|
}
|
|
574
582
|
}, {
|
|
575
583
|
debug: wrap(tsInvariant.invariant.debug),
|
|
@@ -578,20 +586,27 @@ Object.assign(function invariant(condition, message) {
|
|
|
578
586
|
error: wrap(tsInvariant.invariant.error),
|
|
579
587
|
});
|
|
580
588
|
var ApolloErrorMessageHandler = Symbol.for("ApolloErrorMessageHandler_" + version);
|
|
581
|
-
function
|
|
589
|
+
function stringify(arg) {
|
|
590
|
+
return typeof arg == "string"
|
|
591
|
+
? arg
|
|
592
|
+
: stringifyForDisplay(arg, 2).slice(0, 1000);
|
|
593
|
+
}
|
|
594
|
+
function getHandledErrorMsg(message, messageArgs) {
|
|
595
|
+
if (messageArgs === void 0) { messageArgs = []; }
|
|
596
|
+
if (!message)
|
|
597
|
+
return;
|
|
598
|
+
return (global$1[ApolloErrorMessageHandler] &&
|
|
599
|
+
global$1[ApolloErrorMessageHandler](message, messageArgs.map(stringify)));
|
|
600
|
+
}
|
|
601
|
+
function getFallbackErrorMsg(message, messageArgs) {
|
|
582
602
|
if (messageArgs === void 0) { messageArgs = []; }
|
|
583
603
|
if (!message)
|
|
584
604
|
return;
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
591
|
-
version: version,
|
|
592
|
-
message: message,
|
|
593
|
-
args: args,
|
|
594
|
-
}))));
|
|
605
|
+
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
606
|
+
version: version,
|
|
607
|
+
message: message,
|
|
608
|
+
args: messageArgs.map(stringify),
|
|
609
|
+
})));
|
|
595
610
|
}
|
|
596
611
|
|
|
597
612
|
function loadErrorMessageHandler() {
|
|
@@ -614,7 +629,7 @@ function loadErrorMessageHandler() {
|
|
|
614
629
|
return;
|
|
615
630
|
message = definition.message;
|
|
616
631
|
}
|
|
617
|
-
return args.reduce(function (msg, arg) { return msg.replace(
|
|
632
|
+
return args.reduce(function (msg, arg) { return msg.replace(/%[sdfo]/, String(arg)); }, String(message));
|
|
618
633
|
}
|
|
619
634
|
}
|
|
620
635
|
|
|
@@ -20,7 +20,7 @@ export function loadErrorMessageHandler() {
|
|
|
20
20
|
return;
|
|
21
21
|
message = definition.message;
|
|
22
22
|
}
|
|
23
|
-
return args.reduce(function (msg, arg) { return msg.replace(
|
|
23
|
+
return args.reduce(function (msg, arg) { return msg.replace(/%[sdfo]/, String(arg)); }, String(message));
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=loadErrorMessageHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadErrorMessageHandler.js","sourceRoot":"","sources":["../../src/dev/loadErrorMessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,MAAM,UAAU,uBAAuB;IAAC,oBAA2B;SAA3B,UAA2B,EAA3B,qBAA2B,EAA3B,IAA2B;QAA3B,+BAA2B;;IACjE,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE;QACtC,MAAM,CAAC,yBAAyB,CAAC,GAAG,OAAsC,CAAC;KAC5E;IAED,KAAoB,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU,EAAE;QAA3B,IAAM,KAAK,mBAAA;QACd,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE,KAAK,CAAC,CAAC;KACzD;IAED,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAC;IAEzC,SAAS,OAAO,CAAC,OAAwB,EAAE,IAAe;QACxD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,IAAM,UAAU,GAAG,MAAM,CAAC,yBAAyB,CAAE,CAAC,OAAO,CAAC,CAAC;YAC/D,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO;gBAAE,OAAO;YAC5C,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;SAC9B;QACD,OAAO,IAAI,CAAC,MAAM,CAChB,UAAC,GAAG,EAAE,GAAG,IAAK,OAAA,GAAG,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"loadErrorMessageHandler.js","sourceRoot":"","sources":["../../src/dev/loadErrorMessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,MAAM,UAAU,uBAAuB;IAAC,oBAA2B;SAA3B,UAA2B,EAA3B,qBAA2B,EAA3B,IAA2B;QAA3B,+BAA2B;;IACjE,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE;QACtC,MAAM,CAAC,yBAAyB,CAAC,GAAG,OAAsC,CAAC;KAC5E;IAED,KAAoB,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU,EAAE;QAA3B,IAAM,KAAK,mBAAA;QACd,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE,KAAK,CAAC,CAAC;KACzD;IAED,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAC;IAEzC,SAAS,OAAO,CAAC,OAAwB,EAAE,IAAe;QACxD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,IAAM,UAAU,GAAG,MAAM,CAAC,yBAAyB,CAAE,CAAC,OAAO,CAAC,CAAC;YAC/D,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO;gBAAE,OAAO;YAC5C,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;SAC9B;QACD,OAAO,IAAI,CAAC,MAAM,CAChB,UAAC,GAAG,EAAE,GAAG,IAAK,OAAA,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAnC,CAAmC,EACjD,MAAM,CAAC,OAAO,CAAC,CAChB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type { ErrorCodes } from \"../invariantErrorCodes.js\";\nimport { global } from \"../utilities/globals/index.js\";\nimport { ApolloErrorMessageHandler } from \"../utilities/globals/invariantWrappers.js\";\n\nexport function loadErrorMessageHandler(...errorCodes: ErrorCodes[]) {\n if (!global[ApolloErrorMessageHandler]) {\n global[ApolloErrorMessageHandler] = handler as typeof handler & ErrorCodes;\n }\n\n for (const codes of errorCodes) {\n Object.assign(global[ApolloErrorMessageHandler], codes);\n }\n\n return global[ApolloErrorMessageHandler];\n\n function handler(message: string | number, args: unknown[]) {\n if (typeof message === \"number\") {\n const definition = global[ApolloErrorMessageHandler]![message];\n if (!message || !definition.message) return;\n message = definition.message;\n }\n return args.reduce<string>(\n (msg, arg) => msg.replace(/%[sdfo]/, String(arg)),\n String(message)\n );\n }\n}\n"]}
|
package/invariantErrorCodes.js
CHANGED
|
@@ -280,101 +280,107 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
280
280
|
},
|
|
281
281
|
|
|
282
282
|
63: {
|
|
283
|
+
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
284
|
+
condition: "mockedResponse.maxUsageCount > 0",
|
|
285
|
+
message: "Mock response maxUsageCount must be greater than 0, %s given"
|
|
286
|
+
},
|
|
287
|
+
|
|
288
|
+
64: {
|
|
283
289
|
file: "@apollo/client/utilities/graphql/DocumentTransform.js",
|
|
284
290
|
condition: "Array.isArray(cacheKeys)",
|
|
285
291
|
message: "`getCacheKey` must return an array or undefined"
|
|
286
292
|
},
|
|
287
293
|
|
|
288
|
-
|
|
294
|
+
65: {
|
|
289
295
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
290
296
|
condition: "evaledValue !== void 0",
|
|
291
297
|
message: "Invalid variable referenced in @%s directive."
|
|
292
298
|
},
|
|
293
299
|
|
|
294
|
-
|
|
300
|
+
66: {
|
|
295
301
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
296
302
|
condition: "directiveArguments && directiveArguments.length === 1",
|
|
297
303
|
message: "Incorrect number of arguments for the @%s directive."
|
|
298
304
|
},
|
|
299
305
|
|
|
300
|
-
|
|
306
|
+
67: {
|
|
301
307
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
302
308
|
condition: "ifArgument.name && ifArgument.name.value === \"if\"",
|
|
303
309
|
message: "Invalid argument for the @%s directive."
|
|
304
310
|
},
|
|
305
311
|
|
|
306
|
-
|
|
312
|
+
68: {
|
|
307
313
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
308
314
|
condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
|
|
309
315
|
message: "Argument for the @%s directive must be a variable or a boolean value."
|
|
310
316
|
},
|
|
311
317
|
|
|
312
|
-
|
|
318
|
+
69: {
|
|
313
319
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
314
320
|
|
|
315
321
|
message: "Found a %s operation%s. " +
|
|
316
322
|
"No operations are allowed when using a fragment as a query. Only fragments are allowed."
|
|
317
323
|
},
|
|
318
324
|
|
|
319
|
-
|
|
325
|
+
70: {
|
|
320
326
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
321
327
|
condition: "fragments.length === 1",
|
|
322
328
|
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
323
329
|
},
|
|
324
330
|
|
|
325
|
-
|
|
331
|
+
71: {
|
|
326
332
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
327
333
|
condition: "fragment",
|
|
328
334
|
message: "No fragment named %s"
|
|
329
335
|
},
|
|
330
336
|
|
|
331
|
-
|
|
337
|
+
72: {
|
|
332
338
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
333
339
|
condition: "doc && doc.kind === \"Document\"",
|
|
334
340
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
335
341
|
},
|
|
336
342
|
|
|
337
|
-
|
|
343
|
+
73: {
|
|
338
344
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
339
345
|
message: "Schema type definitions not allowed in queries. Found: \"%s\""
|
|
340
346
|
},
|
|
341
347
|
|
|
342
|
-
|
|
348
|
+
74: {
|
|
343
349
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
344
350
|
condition: "operations.length <= 1",
|
|
345
351
|
message: "Ambiguous GraphQL document: contains %s operations"
|
|
346
352
|
},
|
|
347
353
|
|
|
348
|
-
|
|
354
|
+
75: {
|
|
349
355
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
350
356
|
condition: "queryDef && queryDef.operation === \"query\"",
|
|
351
357
|
message: "Must contain a query definition."
|
|
352
358
|
},
|
|
353
359
|
|
|
354
|
-
|
|
360
|
+
76: {
|
|
355
361
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
356
362
|
condition: "doc.kind === \"Document\"",
|
|
357
363
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
358
364
|
},
|
|
359
365
|
|
|
360
|
-
|
|
366
|
+
77: {
|
|
361
367
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
362
368
|
condition: "doc.definitions.length <= 1",
|
|
363
369
|
message: "Fragment must have exactly one definition."
|
|
364
370
|
},
|
|
365
371
|
|
|
366
|
-
|
|
372
|
+
78: {
|
|
367
373
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
368
374
|
condition: "fragmentDef.kind === \"FragmentDefinition\"",
|
|
369
375
|
message: "Must be a fragment definition."
|
|
370
376
|
},
|
|
371
377
|
|
|
372
|
-
|
|
378
|
+
79: {
|
|
373
379
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
374
380
|
message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
|
|
375
381
|
},
|
|
376
382
|
|
|
377
|
-
|
|
383
|
+
80: {
|
|
378
384
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
379
385
|
|
|
380
386
|
message: "The inline argument \"%s\" of kind \"%s\"" +
|
|
@@ -473,7 +479,7 @@ export const devWarn = {
|
|
|
473
479
|
message: "Using `returnPartialData` with a `no-cache` fetch policy has no effect. To read partial data from the cache, consider using an alternate fetch policy."
|
|
474
480
|
},
|
|
475
481
|
|
|
476
|
-
|
|
482
|
+
82: {
|
|
477
483
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
478
484
|
|
|
479
485
|
message: "Removing an @connection directive even though it does not have a key. " +
|
|
@@ -502,7 +508,7 @@ export const devError = {
|
|
|
502
508
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
503
509
|
},
|
|
504
510
|
|
|
505
|
-
|
|
511
|
+
81: {
|
|
506
512
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
507
513
|
message: "Could not find operation or fragment"
|
|
508
514
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apollo/client",
|
|
3
|
-
"version": "3.9.0-alpha.
|
|
3
|
+
"version": "3.9.0-alpha.2",
|
|
4
4
|
"description": "A fully-featured caching GraphQL client.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://www.apollographql.com/docs/react/",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"graphql": "^
|
|
33
|
+
"graphql": "^15.0.0 || ^16.0.0",
|
|
34
34
|
"graphql-ws": "^5.5.5",
|
|
35
35
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
36
36
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"zen-observable-ts": "^1.2.5"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@arethetypeswrong/cli": "0.
|
|
70
|
-
"@babel/parser": "7.
|
|
69
|
+
"@arethetypeswrong/cli": "0.11.0",
|
|
70
|
+
"@babel/parser": "7.23.0",
|
|
71
71
|
"@changesets/changelog-github": "0.4.8",
|
|
72
72
|
"@changesets/cli": "2.26.2",
|
|
73
73
|
"@graphql-tools/schema": "10.0.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@types/hoist-non-react-statics": "3.3.2",
|
|
87
87
|
"@types/jest": "29.5.5",
|
|
88
88
|
"@types/lodash": "4.14.198",
|
|
89
|
-
"@types/node": "20.
|
|
89
|
+
"@types/node": "20.8.0",
|
|
90
90
|
"@types/node-fetch": "2.6.5",
|
|
91
91
|
"@types/react": "18.2.22",
|
|
92
92
|
"@types/react-dom": "18.2.7",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"blob-polyfill": "7.0.20220408",
|
|
101
101
|
"bytes": "3.1.2",
|
|
102
102
|
"cross-fetch": "3.1.8",
|
|
103
|
-
"eslint": "8.
|
|
103
|
+
"eslint": "8.50.0",
|
|
104
104
|
"eslint-import-resolver-typescript": "3.6.0",
|
|
105
105
|
"eslint-plugin-import": "npm:@phryneas/eslint-plugin-import@2.27.5-pr.2813.2817.199971c",
|
|
106
106
|
"eslint-plugin-local-rules": "2.0.0",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"rxjs": "7.8.1",
|
|
130
130
|
"size-limit": "8.2.6",
|
|
131
131
|
"subscriptions-transport-ws": "0.11.0",
|
|
132
|
-
"terser": "5.
|
|
132
|
+
"terser": "5.20.0",
|
|
133
133
|
"ts-api-utils": "1.0.3",
|
|
134
134
|
"ts-jest": "29.1.1",
|
|
135
135
|
"ts-jest-resolver": "2.0.1",
|
package/react/cache/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
export type { SuspenseCacheOptions } from "./SuspenseCache.js";
|
|
2
2
|
export { getSuspenseCache } from "./getSuspenseCache.js";
|
|
3
|
-
import { SuspenseCache as RealSuspenseCache } from "./SuspenseCache.js";
|
|
4
|
-
export declare class SuspenseCache extends RealSuspenseCache {
|
|
5
|
-
constructor();
|
|
6
|
-
}
|
|
7
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/cache/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/cache/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/react/cache/index.js
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
1
|
export { getSuspenseCache } from "./getSuspenseCache.js";
|
|
3
|
-
import { SuspenseCache as RealSuspenseCache } from "./SuspenseCache.js";
|
|
4
|
-
var SuspenseCache = (function (_super) {
|
|
5
|
-
__extends(SuspenseCache, _super);
|
|
6
|
-
function SuspenseCache() {
|
|
7
|
-
var _this = _super.call(this) || this;
|
|
8
|
-
throw new Error("It is no longer necessary to create a `SuspenseCache` instance and pass it into the `ApolloProvider`.\n" +
|
|
9
|
-
"Please remove this code from your application. \n\n" +
|
|
10
|
-
"This export will be removed with the final 3.8 release.");
|
|
11
|
-
return _this;
|
|
12
|
-
}
|
|
13
|
-
return SuspenseCache;
|
|
14
|
-
}(RealSuspenseCache));
|
|
15
|
-
export { SuspenseCache };
|
|
16
2
|
//# sourceMappingURL=index.js.map
|
package/react/cache/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/cache/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/cache/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export type { SuspenseCacheOptions } from \"./SuspenseCache.js\";\nexport { getSuspenseCache } from \"./getSuspenseCache.js\";\n"]}
|
package/react/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import "../utilities/globals/index.js";
|
|
|
2
2
|
export type { ApolloContextValue } from "./context/index.js";
|
|
3
3
|
export { ApolloProvider, ApolloConsumer, getApolloContext, resetApolloContext, } from "./context/index.js";
|
|
4
4
|
export * from "./hooks/index.js";
|
|
5
|
-
export { SuspenseCache } from "./cache/index.js";
|
|
6
5
|
export type { IDocumentDefinition } from "./parser/index.js";
|
|
7
6
|
export { DocumentType, operationName, parser } from "./parser/index.js";
|
|
8
7
|
export * from "./types/types.js";
|
package/react/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAEvC,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,cAAc,kBAAkB,CAAC;AAEjC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAEvC,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,cAAc,kBAAkB,CAAC;AAEjC,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAExE,cAAc,kBAAkB,CAAC"}
|
package/react/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "../utilities/globals/index.js";
|
|
2
2
|
export { ApolloProvider, ApolloConsumer, getApolloContext, resetApolloContext, } from "./context/index.js";
|
|
3
3
|
export * from "./hooks/index.js";
|
|
4
|
-
export { SuspenseCache } from "./cache/index.js";
|
|
5
4
|
export { DocumentType, operationName, parser } from "./parser/index.js";
|
|
6
5
|
export * from "./types/types.js";
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
package/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAGvC,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,cAAc,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAGvC,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAExE,cAAc,kBAAkB,CAAC","sourcesContent":["import \"../utilities/globals/index.js\";\n\nexport type { ApolloContextValue } from \"./context/index.js\";\nexport {\n ApolloProvider,\n ApolloConsumer,\n getApolloContext,\n resetApolloContext,\n} from \"./context/index.js\";\n\nexport * from \"./hooks/index.js\";\n\nexport type { IDocumentDefinition } from \"./parser/index.js\";\nexport { DocumentType, operationName, parser } from \"./parser/index.js\";\n\nexport * from \"./types/types.js\";\n"]}
|