@apollo/client 4.1.0-alpha.0 → 4.1.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/CHANGELOG.md +47 -0
- package/__cjs/cache/core/cache.cjs +1 -1
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +19 -0
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs +3 -0
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +1 -0
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/key-extractor.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.cjs +4 -4
- package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/core/ApolloClient.cjs +14 -13
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +12 -0
- package/__cjs/core/ObservableQuery.cjs +6 -6
- package/__cjs/core/QueryManager.cjs +19 -17
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/incremental/handlers/graphql17Alpha9.cjs +1 -1
- package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
- package/__cjs/incremental/handlers/notImplemented.cjs.map +1 -1
- package/__cjs/invariantErrorCodes.cjs +72 -62
- package/__cjs/link/core/ApolloLink.cjs +3 -3
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/ws/index.cjs +1 -1
- package/__cjs/local-state/LocalState.cjs +28 -14
- package/__cjs/local-state/LocalState.cjs.map +1 -1
- package/__cjs/local-state/LocalState.d.cts +3 -2
- package/__cjs/react/hooks/useMutation.cjs +7 -1
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +13 -1
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.d.ts +19 -0
- package/cache/core/cache.js +1 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +1 -0
- package/cache/inmemory/inMemoryCache.js +3 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/key-extractor.js.map +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.d.ts +12 -0
- package/core/ApolloClient.js +14 -13
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.js +6 -6
- package/core/QueryManager.js +19 -17
- package/core/QueryManager.js.map +1 -1
- package/incremental/handlers/graphql17Alpha9.js +1 -1
- package/incremental/handlers/notImplemented.js +1 -1
- package/incremental/handlers/notImplemented.js.map +1 -1
- package/invariantErrorCodes.js +72 -62
- package/link/core/ApolloLink.js +3 -3
- package/link/http/checkFetcher.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/ws/index.js +1 -1
- package/local-state/LocalState.d.ts +3 -2
- package/local-state/LocalState.js +28 -14
- package/local-state/LocalState.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useMutation.d.ts +13 -1
- package/react/hooks/useMutation.js +7 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks-compiled/useMutation.d.ts +13 -1
- package/react/hooks-compiled/useMutation.js +5 -1
- package/react/hooks-compiled/useMutation.js.map +1 -1
- package/version.js +1 -1
|
@@ -33,7 +33,7 @@ class IncrementalRequest {
|
|
|
33
33
|
if (hasIncrementalChunks(chunk)) {
|
|
34
34
|
for (const incremental of chunk.incremental) {
|
|
35
35
|
const pending = this.pending.find(({ id }) => incremental.id === id);
|
|
36
|
-
invariant(pending,
|
|
36
|
+
invariant(pending, 66);
|
|
37
37
|
const path = pending.path.concat(incremental.subPath ?? []);
|
|
38
38
|
let data;
|
|
39
39
|
let arrayMerge = "truncate";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notImplemented.js","sources":["../../../src/incremental/handlers/notImplemented.ts"],"sourcesContent":["import type { ApolloLink } from \"@apollo/client/link\";\nimport type { HKT } from \"@apollo/client/utilities\";\nimport { hasDirectives } from \"@apollo/client/utilities/internal\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport type { Incremental } from \"../types.js\";\n\nexport declare namespace NotImplementedHandler {\n interface NotImplementedResult extends HKT {\n arg1: unknown; // TData\n arg2: unknown; // TExtensions\n return: never;\n }\n export interface TypeOverrides {\n AdditionalApolloLinkResultTypes: NotImplementedResult;\n }\n}\n\nexport class NotImplementedHandler implements Incremental.Handler<never> {\n isIncrementalResult(_: any): _ is never {\n return false;\n }\n prepareRequest(request: ApolloLink.Request) {\n invariant(\n !hasDirectives([\"defer\"], request.query),\n \"`@defer`
|
|
1
|
+
{"version":3,"file":"notImplemented.js","sources":["../../../src/incremental/handlers/notImplemented.ts"],"sourcesContent":["import type { ApolloLink } from \"@apollo/client/link\";\nimport type { HKT } from \"@apollo/client/utilities\";\nimport { hasDirectives } from \"@apollo/client/utilities/internal\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport type { Incremental } from \"../types.js\";\n\nexport declare namespace NotImplementedHandler {\n interface NotImplementedResult extends HKT {\n arg1: unknown; // TData\n arg2: unknown; // TExtensions\n return: never;\n }\n export interface TypeOverrides {\n AdditionalApolloLinkResultTypes: NotImplementedResult;\n }\n}\n\nexport class NotImplementedHandler implements Incremental.Handler<never> {\n isIncrementalResult(_: any): _ is never {\n return false;\n }\n prepareRequest(request: ApolloLink.Request) {\n invariant(\n !hasDirectives([\"defer\", \"stream\"], request.query),\n \"`@defer` and `@stream` are not supported without specifying an incremental handler. Please pass a handler as the `incrementalHandler` option to the `ApolloClient` constructor.\"\n );\n\n return request;\n }\n extractErrors() {}\n // This code path can never be reached, so we won't implement it.\n startRequest = undefined as any;\n}\n"],"names":[],"mappings":"AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA8B,CAA9B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiE;AACjE,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA0B,CAA1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAe9D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAa,CAAb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;IACE,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,CAAC,CAAM,EAA5B;QACI,CAAJ,CAAA,CAAA,CAAA,CAAA,EAAW,CAAX,CAAA,CAAA,CAAA,CAAgB;IACd;IACA,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,CAAC,CAAjB,CAAA,CAAA,CAAA,CAAA,CAAA,CAA4C,EAA5C;QACI,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EACM,CAAC,CADP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACoB,CAAC,CAAC,CADtB,CAAA,CAAA,CAAA,CAAA,CAAA,CAC6B,EAAE,CAD/B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACuC,CAAC,EAAE,CAD1C,CAAA,CAAA,CAAA,CAAA,CAAA,CACiD,CAAC,CADlD,CAAA,CAAA,CAAA,CACuD,MAElD;QAED,CAAJ,CAAA,CAAA,CAAA,CAAA,EAAW,CAAX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB;IAChB;IACA,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAf,EAAA,EAAmB;IACjB,CAAF,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA;IACE,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAiB,CAAjB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiC;AACjC;"}
|
package/invariantErrorCodes.js
CHANGED
|
@@ -272,24 +272,24 @@ you have an infinite render loop in your application.`
|
|
|
272
272
|
message: "No fragment named %s"
|
|
273
273
|
},
|
|
274
274
|
|
|
275
|
-
|
|
275
|
+
55: {
|
|
276
276
|
file: "@apollo/client/local-state/LocalState.js",
|
|
277
277
|
message: "Could not resolve __typename on object %o returned from resolver '%s'. '__typename' needs to be returned to properly resolve child fields."
|
|
278
278
|
},
|
|
279
279
|
|
|
280
|
-
|
|
280
|
+
56: {
|
|
281
281
|
file: "@apollo/client/local-state/LocalState.js",
|
|
282
282
|
condition: "fragment",
|
|
283
283
|
message: `No fragment named %s`
|
|
284
284
|
},
|
|
285
285
|
|
|
286
|
-
|
|
286
|
+
57: {
|
|
287
287
|
file: "@apollo/client/local-state/LocalState.js",
|
|
288
288
|
condition: "cache.fragmentMatches",
|
|
289
289
|
message: "The configured cache does not support fragment matching which will lead to incorrect results when executing local resolvers. Please use a cache that implements `fragmetMatches`."
|
|
290
290
|
},
|
|
291
291
|
|
|
292
|
-
|
|
292
|
+
59: {
|
|
293
293
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
294
294
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
295
295
|
|
|
@@ -298,13 +298,13 @@ you have an infinite render loop in your application.`
|
|
|
298
298
|
"parameter."
|
|
299
299
|
},
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
60: {
|
|
302
302
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
303
303
|
condition: "forward",
|
|
304
304
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
305
305
|
},
|
|
306
306
|
|
|
307
|
-
|
|
307
|
+
61: {
|
|
308
308
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
309
309
|
condition: "fetcher || typeof fetch !== \"undefined\"",
|
|
310
310
|
|
|
@@ -322,30 +322,30 @@ const client = new ApolloClient({
|
|
|
322
322
|
`
|
|
323
323
|
},
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
62: {
|
|
326
326
|
file: "@apollo/client/link/http/parseAndCheckHttpResponse.js",
|
|
327
327
|
condition: "response.body && typeof response.body.getReader === \"function\"",
|
|
328
328
|
message: "Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`."
|
|
329
329
|
},
|
|
330
330
|
|
|
331
|
-
|
|
331
|
+
65: {
|
|
332
332
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
333
333
|
message: "request is not implemented"
|
|
334
334
|
},
|
|
335
335
|
|
|
336
|
-
|
|
336
|
+
66: {
|
|
337
337
|
file: "@apollo/client/incremental/handlers/graphql17Alpha9.js",
|
|
338
338
|
condition: "pending",
|
|
339
339
|
message: "Could not find pending chunk for incremental value. Please file an issue for the Apollo Client team to investigate."
|
|
340
340
|
},
|
|
341
341
|
|
|
342
|
-
|
|
342
|
+
67: {
|
|
343
343
|
file: "@apollo/client/incremental/handlers/notImplemented.js",
|
|
344
|
-
condition: "!hasDirectives([\"defer\"], request.query)",
|
|
345
|
-
message: "`@defer`
|
|
344
|
+
condition: "!hasDirectives([\"defer\", \"stream\"], request.query)",
|
|
345
|
+
message: "`@defer` and `@stream` are not supported without specifying an incremental handler. Please pass a handler as the `incrementalHandler` option to the `ApolloClient` constructor."
|
|
346
346
|
},
|
|
347
347
|
|
|
348
|
-
|
|
348
|
+
68: {
|
|
349
349
|
file: "@apollo/client/core/ApolloClient.js",
|
|
350
350
|
condition: "options.cache",
|
|
351
351
|
|
|
@@ -354,7 +354,7 @@ const client = new ApolloClient({
|
|
|
354
354
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
355
355
|
},
|
|
356
356
|
|
|
357
|
-
|
|
357
|
+
69: {
|
|
358
358
|
file: "@apollo/client/core/ApolloClient.js",
|
|
359
359
|
condition: "options.link",
|
|
360
360
|
|
|
@@ -363,7 +363,7 @@ const client = new ApolloClient({
|
|
|
363
363
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
364
364
|
},
|
|
365
365
|
|
|
366
|
-
|
|
366
|
+
70: {
|
|
367
367
|
file: "@apollo/client/core/ApolloClient.js",
|
|
368
368
|
condition: "options.fetchPolicy !== \"cache-and-network\"",
|
|
369
369
|
|
|
@@ -373,7 +373,7 @@ const client = new ApolloClient({
|
|
|
373
373
|
"using a different fetchPolicy, such as cache-first or network-only."
|
|
374
374
|
},
|
|
375
375
|
|
|
376
|
-
|
|
376
|
+
71: {
|
|
377
377
|
file: "@apollo/client/core/ApolloClient.js",
|
|
378
378
|
condition: "options.fetchPolicy !== \"standby\"",
|
|
379
379
|
|
|
@@ -382,7 +382,7 @@ const client = new ApolloClient({
|
|
|
382
382
|
"as cache-first or network-only."
|
|
383
383
|
},
|
|
384
384
|
|
|
385
|
-
|
|
385
|
+
72: {
|
|
386
386
|
file: "@apollo/client/core/ApolloClient.js",
|
|
387
387
|
condition: "options.query",
|
|
388
388
|
|
|
@@ -390,158 +390,158 @@ const client = new ApolloClient({
|
|
|
390
390
|
"in the query option."
|
|
391
391
|
},
|
|
392
392
|
|
|
393
|
-
|
|
393
|
+
73: {
|
|
394
394
|
file: "@apollo/client/core/ApolloClient.js",
|
|
395
395
|
condition: "options.query.kind === \"Document\"",
|
|
396
396
|
message: 'You must wrap the query string in a "gql" tag.'
|
|
397
397
|
},
|
|
398
398
|
|
|
399
|
-
|
|
399
|
+
74: {
|
|
400
400
|
file: "@apollo/client/core/ApolloClient.js",
|
|
401
401
|
condition: "!options.returnPartialData",
|
|
402
402
|
message: "returnPartialData option only supported on watchQuery."
|
|
403
403
|
},
|
|
404
404
|
|
|
405
|
-
|
|
405
|
+
75: {
|
|
406
406
|
file: "@apollo/client/core/ApolloClient.js",
|
|
407
407
|
condition: "!options.pollInterval",
|
|
408
408
|
message: "pollInterval option only supported on watchQuery."
|
|
409
409
|
},
|
|
410
410
|
|
|
411
|
-
|
|
411
|
+
76: {
|
|
412
412
|
file: "@apollo/client/core/ApolloClient.js",
|
|
413
413
|
condition: "!options.notifyOnNetworkStatusChange",
|
|
414
414
|
message: "notifyOnNetworkStatusChange option only supported on watchQuery."
|
|
415
415
|
},
|
|
416
416
|
|
|
417
|
-
|
|
417
|
+
77: {
|
|
418
418
|
file: "@apollo/client/core/ApolloClient.js",
|
|
419
419
|
condition: "optionsWithDefaults.mutation",
|
|
420
420
|
message: "The `mutation` option is required. Please provide a GraphQL document in the `mutation` option."
|
|
421
421
|
},
|
|
422
422
|
|
|
423
|
-
|
|
423
|
+
78: {
|
|
424
424
|
file: "@apollo/client/core/ApolloClient.js",
|
|
425
425
|
condition: "optionsWithDefaults.fetchPolicy === \"network-only\" ||\n optionsWithDefaults.fetchPolicy === \"no-cache\"",
|
|
426
426
|
message: "Mutations only support 'network-only' or 'no-cache' fetch policies. The default 'network-only' behavior automatically writes mutation results to the cache. Passing 'no-cache' skips the cache write."
|
|
427
427
|
},
|
|
428
428
|
|
|
429
|
-
|
|
429
|
+
81: {
|
|
430
430
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
431
431
|
condition: "this.options.fetchPolicy !== \"cache-only\"",
|
|
432
432
|
message: "Cannot execute `fetchMore` for 'cache-only' query '%s'. Please use a different fetch policy."
|
|
433
433
|
},
|
|
434
434
|
|
|
435
|
-
|
|
435
|
+
82: {
|
|
436
436
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
437
437
|
condition: "updateQuery",
|
|
438
438
|
message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
|
|
439
439
|
},
|
|
440
440
|
|
|
441
|
-
|
|
441
|
+
86: {
|
|
442
442
|
file: "@apollo/client/core/QueryManager.js",
|
|
443
443
|
message: "QueryManager stopped while query was in flight"
|
|
444
444
|
},
|
|
445
445
|
|
|
446
|
-
|
|
446
|
+
87: {
|
|
447
447
|
file: "@apollo/client/core/QueryManager.js",
|
|
448
448
|
condition: "this.localState",
|
|
449
449
|
message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
450
450
|
},
|
|
451
451
|
|
|
452
|
-
|
|
452
|
+
88: {
|
|
453
453
|
file: "@apollo/client/core/QueryManager.js",
|
|
454
454
|
message: "Store reset while query was in flight (not completed in link chain)"
|
|
455
455
|
},
|
|
456
456
|
|
|
457
|
-
|
|
457
|
+
91: {
|
|
458
458
|
file: "@apollo/client/core/QueryManager.js",
|
|
459
459
|
condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
|
|
460
460
|
message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
461
461
|
},
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
92: {
|
|
464
464
|
file: "@apollo/client/core/QueryManager.js",
|
|
465
465
|
condition: "this.localState",
|
|
466
466
|
message: "%s '%s' contains `@client` fields but local state has not been configured."
|
|
467
467
|
},
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
93: {
|
|
470
470
|
file: "@apollo/client/core/QueryManager.js",
|
|
471
471
|
condition: "!hasIncrementalDirective",
|
|
472
472
|
message: "%s '%s' contains `@client` and `@defer` directives. These cannot be used together."
|
|
473
473
|
},
|
|
474
474
|
|
|
475
|
-
|
|
475
|
+
94: {
|
|
476
476
|
file: "@apollo/client/core/QueryManager.js",
|
|
477
477
|
condition: "this.localState",
|
|
478
478
|
message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
479
479
|
},
|
|
480
480
|
|
|
481
|
-
|
|
481
|
+
96: {
|
|
482
482
|
file: "@apollo/client/core/QueryManager.js",
|
|
483
483
|
condition: "this.localState",
|
|
484
484
|
message: "Query '%s' contains `@client` fields but local state has not been configured."
|
|
485
485
|
},
|
|
486
486
|
|
|
487
|
-
|
|
487
|
+
97: {
|
|
488
488
|
file: "@apollo/client/core/QueryManager.js",
|
|
489
489
|
condition: "didEmitValue",
|
|
490
490
|
message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
|
|
491
491
|
},
|
|
492
492
|
|
|
493
|
-
|
|
493
|
+
98: {
|
|
494
494
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
495
495
|
condition: "typeof dataId === \"string\"",
|
|
496
496
|
message: "store.merge expects a string ID"
|
|
497
497
|
},
|
|
498
498
|
|
|
499
|
-
|
|
499
|
+
101: {
|
|
500
500
|
file: "@apollo/client/cache/inmemory/key-extractor.js",
|
|
501
501
|
condition: "extracted !== void 0",
|
|
502
502
|
message: `Missing field '%s' while extracting keyFields from %s`
|
|
503
503
|
},
|
|
504
504
|
|
|
505
|
-
|
|
505
|
+
102: {
|
|
506
506
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
507
507
|
condition: "!old || old === which",
|
|
508
508
|
message: `Cannot change root %s __typename more than once`
|
|
509
509
|
},
|
|
510
510
|
|
|
511
|
-
|
|
511
|
+
105: {
|
|
512
512
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
513
513
|
message: "Cannot automatically merge arrays"
|
|
514
514
|
},
|
|
515
515
|
|
|
516
|
-
|
|
516
|
+
106: {
|
|
517
517
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
518
518
|
message: `No fragment named %s`
|
|
519
519
|
},
|
|
520
520
|
|
|
521
|
-
|
|
521
|
+
107: {
|
|
522
522
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
523
523
|
condition: "!isReference(value)",
|
|
524
524
|
message: `Missing selection set for object of type %s returned for query field %s`
|
|
525
525
|
},
|
|
526
526
|
|
|
527
|
-
|
|
527
|
+
108: {
|
|
528
528
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
529
529
|
message: `Could not identify object %s`
|
|
530
530
|
},
|
|
531
531
|
|
|
532
|
-
|
|
532
|
+
110: {
|
|
533
533
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
534
534
|
message: `No fragment named %s`
|
|
535
535
|
}
|
|
536
536
|
};
|
|
537
537
|
|
|
538
538
|
export const devDebug = {
|
|
539
|
-
|
|
539
|
+
79: {
|
|
540
540
|
file: "@apollo/client/core/ApolloClient.js",
|
|
541
541
|
message: `In client.refetchQueries, Promise.all promise rejected with error %o`
|
|
542
542
|
},
|
|
543
543
|
|
|
544
|
-
|
|
544
|
+
85: {
|
|
545
545
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
546
546
|
message: `Missing cache result fields: %o`
|
|
547
547
|
}
|
|
@@ -577,30 +577,40 @@ export const devWarn = {
|
|
|
577
577
|
|
|
578
578
|
50: {
|
|
579
579
|
file: "@apollo/client/local-state/LocalState.js",
|
|
580
|
-
message: "The '%s'
|
|
580
|
+
message: "The '%s' field resolves the value from the cache, for example from a 'read' function, but a 'no-cache' fetch policy was used. The field value has been set to `null`. Either define a local resolver or use a fetch policy that uses the cache to ensure the field is resolved correctly."
|
|
581
581
|
},
|
|
582
582
|
|
|
583
583
|
51: {
|
|
584
584
|
file: "@apollo/client/local-state/LocalState.js",
|
|
585
|
-
message: "
|
|
585
|
+
message: "Could not find a resolver for the '%s' field nor does the cache resolve the field. The field value has been set to `null`. Either define a resolver for the field or ensure the cache can resolve the value, for example, by adding a 'read' function to a field policy in 'InMemoryCache'."
|
|
586
586
|
},
|
|
587
587
|
|
|
588
588
|
52: {
|
|
589
|
+
file: "@apollo/client/local-state/LocalState.js",
|
|
590
|
+
message: "The '%s' resolver returned `undefined` instead of a value. This is likely a bug in the resolver. If you didn't mean to return a value, return `null` instead."
|
|
591
|
+
},
|
|
592
|
+
|
|
593
|
+
53: {
|
|
594
|
+
file: "@apollo/client/local-state/LocalState.js",
|
|
595
|
+
message: "The '%s' field had no cached value and only forced resolvers were run. The value was set to `null`."
|
|
596
|
+
},
|
|
597
|
+
|
|
598
|
+
54: {
|
|
589
599
|
file: "@apollo/client/local-state/LocalState.js",
|
|
590
600
|
message: "The '%s' field on object %o returned `undefined` instead of a value. The parent resolver did not include the property in the returned value and there was no resolver defined for the field."
|
|
591
601
|
},
|
|
592
602
|
|
|
593
|
-
|
|
603
|
+
58: {
|
|
594
604
|
file: "@apollo/client/link/ws/index.js",
|
|
595
605
|
message: "`WebSocketLink` uses the deprecated and unmaintained `subscriptions-transport-ws` library. This link is no longer maintained and will be removed in a future major version of Apollo Client. We recommend switching to `GraphQLWsLink` which uses the `graphql-ws` library to send GraphQL operations through WebSocket connections (https://the-guild.dev/graphql/ws)."
|
|
596
606
|
},
|
|
597
607
|
|
|
598
|
-
|
|
608
|
+
63: {
|
|
599
609
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
600
610
|
message: "[ApolloLink.split]: The test function returned a non-boolean value which could result in subtle bugs (e.g. such as using an `async` function which always returns a truthy value). Got `%o`."
|
|
601
611
|
},
|
|
602
612
|
|
|
603
|
-
|
|
613
|
+
64: {
|
|
604
614
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
605
615
|
|
|
606
616
|
message: "The terminating link provided to `ApolloLink.execute` called `forward` instead of handling the request. " +
|
|
@@ -609,34 +619,34 @@ export const devWarn = {
|
|
|
609
619
|
"If you are using a split link, ensure each branch contains a terminating link that handles the request."
|
|
610
620
|
},
|
|
611
621
|
|
|
612
|
-
|
|
622
|
+
80: {
|
|
613
623
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
614
624
|
|
|
615
625
|
message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
|
|
616
626
|
Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
617
627
|
},
|
|
618
628
|
|
|
619
|
-
|
|
629
|
+
84: {
|
|
620
630
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
621
631
|
message: "Cannot poll on 'cache-only' query '%s' and as such, polling is disabled. Please use a different fetch policy."
|
|
622
632
|
},
|
|
623
633
|
|
|
624
|
-
|
|
634
|
+
89: {
|
|
625
635
|
file: "@apollo/client/core/QueryManager.js",
|
|
626
636
|
message: `Unknown query named "%s" requested in refetchQueries options.include array`
|
|
627
637
|
},
|
|
628
638
|
|
|
629
|
-
|
|
639
|
+
90: {
|
|
630
640
|
file: "@apollo/client/core/QueryManager.js",
|
|
631
641
|
message: `Unknown anonymous query requested in refetchQueries options.include array`
|
|
632
642
|
},
|
|
633
643
|
|
|
634
|
-
|
|
644
|
+
95: {
|
|
635
645
|
file: "@apollo/client/core/QueryManager.js",
|
|
636
646
|
message: '[%s]: Fragments masked by data masking are inaccessible when using fetch policy "no-cache". Please add `@unmask` to each fragment spread to access the data.'
|
|
637
647
|
},
|
|
638
648
|
|
|
639
|
-
|
|
649
|
+
99: {
|
|
640
650
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
641
651
|
|
|
642
652
|
message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
|
|
@@ -644,24 +654,24 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
|
644
654
|
"`toReference(object, true)`"
|
|
645
655
|
},
|
|
646
656
|
|
|
647
|
-
|
|
657
|
+
100: {
|
|
648
658
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
649
659
|
|
|
650
660
|
message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
|
|
651
661
|
"Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
|
|
652
662
|
},
|
|
653
663
|
|
|
654
|
-
|
|
664
|
+
103: {
|
|
655
665
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
656
666
|
message: `Inferring subtype %s of supertype %s`
|
|
657
667
|
},
|
|
658
668
|
|
|
659
|
-
|
|
669
|
+
104: {
|
|
660
670
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
661
671
|
message: `Undefined 'from' passed to readField with arguments %s`
|
|
662
672
|
},
|
|
663
673
|
|
|
664
|
-
|
|
674
|
+
111: {
|
|
665
675
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
666
676
|
|
|
667
677
|
message: `Cache data may be lost when replacing the %s field of a %s object.
|
|
@@ -680,7 +690,7 @@ For more information about these options, please refer to the documentation:
|
|
|
680
690
|
`
|
|
681
691
|
},
|
|
682
692
|
|
|
683
|
-
|
|
693
|
+
112: {
|
|
684
694
|
file: "@apollo/client/cache/core/cache.js",
|
|
685
695
|
message: "Could not identify object passed to `from` for '%s' fragment, either because the object is non-normalized or the key fields are missing. If you are masking this object, please ensure the key fields are requested by the parent object."
|
|
686
696
|
}
|
|
@@ -697,12 +707,12 @@ export const devError = {
|
|
|
697
707
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
698
708
|
},
|
|
699
709
|
|
|
700
|
-
|
|
710
|
+
83: {
|
|
701
711
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
702
712
|
message: "Unhandled GraphQL subscription error"
|
|
703
713
|
},
|
|
704
714
|
|
|
705
|
-
|
|
715
|
+
109: {
|
|
706
716
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
707
717
|
message: `Missing field '%s' while writing result %o`
|
|
708
718
|
}
|
package/link/core/ApolloLink.js
CHANGED
|
@@ -100,7 +100,7 @@ export class ApolloLink {
|
|
|
100
100
|
const result = test(operation);
|
|
101
101
|
if (__DEV__) {
|
|
102
102
|
if (typeof result !== "boolean") {
|
|
103
|
-
__DEV__ && invariant.warn(
|
|
103
|
+
__DEV__ && invariant.warn(63, result);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
return result ?
|
|
@@ -142,7 +142,7 @@ export class ApolloLink {
|
|
|
142
142
|
static execute(link, request, context) {
|
|
143
143
|
return link.request(createOperation(request, context), () => {
|
|
144
144
|
if (__DEV__) {
|
|
145
|
-
__DEV__ && invariant.warn(
|
|
145
|
+
__DEV__ && invariant.warn(64);
|
|
146
146
|
}
|
|
147
147
|
return EMPTY;
|
|
148
148
|
});
|
|
@@ -246,7 +246,7 @@ export class ApolloLink {
|
|
|
246
246
|
* > request instead.
|
|
247
247
|
*/
|
|
248
248
|
request(operation, forward) {
|
|
249
|
-
throw newInvariantError(
|
|
249
|
+
throw newInvariantError(65);
|
|
250
250
|
}
|
|
251
251
|
/**
|
|
252
252
|
* @internal
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { invariant } from "@apollo/client/utilities/invariant";
|
|
2
2
|
export const checkFetcher = (fetcher) => {
|
|
3
|
-
invariant(fetcher || typeof fetch !== "undefined",
|
|
3
|
+
invariant(fetcher || typeof fetch !== "undefined", 61);
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=checkFetcher.js.map
|
|
@@ -33,7 +33,7 @@ async function* consumeMultipartBody(response) {
|
|
|
33
33
|
/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i);
|
|
34
34
|
const boundary = "\r\n--" + (match?.findLast((val) => !!val) || "-");
|
|
35
35
|
let buffer = "";
|
|
36
|
-
invariant(response.body && typeof response.body.getReader === "function",
|
|
36
|
+
invariant(response.body && typeof response.body.getReader === "function", 62);
|
|
37
37
|
const stream = response.body;
|
|
38
38
|
const reader = stream.getReader();
|
|
39
39
|
let done = false;
|
|
@@ -66,7 +66,7 @@ export class PersistedQueryLink extends ApolloLink {
|
|
|
66
66
|
// hashing with something other than SHA-256.
|
|
67
67
|
invariant(options &&
|
|
68
68
|
(typeof options.sha256 === "function" ||
|
|
69
|
-
typeof options.generateHash === "function"),
|
|
69
|
+
typeof options.generateHash === "function"), 59);
|
|
70
70
|
const { sha256,
|
|
71
71
|
// If both a `sha256` and `generateHash` option are provided, the
|
|
72
72
|
// `sha256` option will be ignored. Developers can configure and
|
|
@@ -92,7 +92,7 @@ export class PersistedQueryLink extends ApolloLink {
|
|
|
92
92
|
return hash;
|
|
93
93
|
}
|
|
94
94
|
super((operation, forward) => {
|
|
95
|
-
invariant(forward,
|
|
95
|
+
invariant(forward, 60);
|
|
96
96
|
const { query } = operation;
|
|
97
97
|
return new Observable((observer) => {
|
|
98
98
|
let subscription;
|
package/link/ws/index.js
CHANGED
|
@@ -32,7 +32,7 @@ export class WebSocketLink extends ApolloLink {
|
|
|
32
32
|
constructor(paramsOrClient) {
|
|
33
33
|
super();
|
|
34
34
|
if (__DEV__) {
|
|
35
|
-
__DEV__ && invariant.warn(
|
|
35
|
+
__DEV__ && invariant.warn(58);
|
|
36
36
|
}
|
|
37
37
|
if (paramsOrClient instanceof SubscriptionClient) {
|
|
38
38
|
this.subscriptionClient = paramsOrClient;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DocumentNode, FieldNode, FormattedExecutionResult } from "graphql";
|
|
2
|
-
import type { ApolloClient, DefaultContext, OperationVariables, TypedDocumentNode } from "@apollo/client";
|
|
2
|
+
import type { ApolloClient, DefaultContext, OperationVariables, TypedDocumentNode, WatchQueryFetchPolicy } from "@apollo/client";
|
|
3
3
|
import type { FragmentMap, NoInfer, RemoveIndexSignature } from "@apollo/client/utilities/internal";
|
|
4
4
|
type InferContextValueFromResolvers<TResolvers> = TResolvers extends {
|
|
5
5
|
[typename: string]: infer TFieldResolvers;
|
|
@@ -155,7 +155,7 @@ export declare class LocalState<TResolvers extends LocalState.Resolvers = LocalS
|
|
|
155
155
|
* ```
|
|
156
156
|
*/
|
|
157
157
|
addResolvers(resolvers: TResolvers): void;
|
|
158
|
-
execute<TData = unknown, TVariables extends OperationVariables = OperationVariables>({ document, client, context, remoteResult, variables, onlyRunForcedResolvers, returnPartialData, }: {
|
|
158
|
+
execute<TData = unknown, TVariables extends OperationVariables = OperationVariables>({ document, client, context, remoteResult, variables, onlyRunForcedResolvers, returnPartialData, fetchPolicy, }: {
|
|
159
159
|
document: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
160
160
|
client: ApolloClient;
|
|
161
161
|
context: DefaultContext | undefined;
|
|
@@ -163,6 +163,7 @@ export declare class LocalState<TResolvers extends LocalState.Resolvers = LocalS
|
|
|
163
163
|
variables: TVariables | undefined;
|
|
164
164
|
onlyRunForcedResolvers?: boolean;
|
|
165
165
|
returnPartialData?: boolean;
|
|
166
|
+
fetchPolicy: WatchQueryFetchPolicy;
|
|
166
167
|
}): Promise<FormattedExecutionResult<TData>>;
|
|
167
168
|
getExportedVariables<TVariables extends OperationVariables = OperationVariables>({ document, client, context, variables, }: {
|
|
168
169
|
document: DocumentNode | TypedDocumentNode<any, TVariables>;
|