@apollo/client 4.0.0-rc.0 → 4.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/__cjs/cache/core/cache.cjs +1 -1
- package/__cjs/cache/index.cjs.map +1 -1
- package/__cjs/cache/index.d.cts +1 -1
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- package/__cjs/cache/inmemory/inMemoryCache.cjs +2 -7
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- 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 +4 -6
- package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.d.cts +0 -1
- package/__cjs/cache/inmemory/types.d.cts +0 -5
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/core/ApolloClient.cjs +14 -21
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +0 -7
- package/__cjs/core/ObservableQuery.cjs +6 -6
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryManager.cjs +13 -12
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/watchQueryOptions.d.cts +7 -7
- package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
- package/__cjs/invariantErrorCodes.cjs +59 -64
- package/__cjs/link/core/ApolloLink.cjs +2 -2
- package/__cjs/link/core/types.d.cts +3 -1
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/utils/validateOperation.cjs +2 -1
- package/__cjs/link/utils/validateOperation.cjs.map +1 -1
- package/__cjs/local-state/LocalState.cjs +6 -9
- package/__cjs/local-state/LocalState.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +2 -2
- package/__cjs/react/hooks/useQuery.cjs +11 -3
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/testing/react/MockedProvider.cjs +2 -2
- package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
- package/__cjs/testing/react/MockedProvider.d.cts +2 -6
- package/__cjs/utilities/index.cjs +3 -1
- package/__cjs/utilities/index.cjs.map +1 -1
- package/__cjs/utilities/index.d.cts +1 -0
- package/__cjs/utilities/internal/getMainDefinition.cjs +1 -6
- package/__cjs/utilities/internal/getMainDefinition.cjs.map +1 -1
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.js +1 -1
- package/cache/index.d.ts +1 -1
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/inMemoryCache.js +2 -7
- 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.d.ts +0 -1
- package/cache/inmemory/readFromStore.js +4 -6
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +0 -5
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.d.ts +0 -7
- package/core/ApolloClient.js +14 -21
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.js +6 -6
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +13 -12
- package/core/QueryManager.js.map +1 -1
- package/core/watchQueryOptions.d.ts +7 -7
- package/incremental/handlers/notImplemented.js +1 -1
- package/invariantErrorCodes.js +59 -64
- package/link/core/ApolloLink.js +2 -2
- package/link/core/types.d.ts +3 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/utils/validateOperation.js +2 -1
- package/link/utils/validateOperation.js.map +1 -1
- package/local-state/LocalState.js +6 -9
- package/local-state/LocalState.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useMutation.d.ts +2 -2
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.js +12 -4
- package/react/hooks/useQuery.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +2 -6
- package/testing/react/MockedProvider.js +2 -2
- package/testing/react/MockedProvider.js.map +1 -1
- package/utilities/index.d.ts +1 -0
- package/utilities/index.js +1 -0
- package/utilities/index.js.map +1 -1
- package/utilities/internal/getMainDefinition.js +1 -6
- package/utilities/internal/getMainDefinition.js.map +1 -1
- package/version.js +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
2
2
|
import type { DocumentNode } from "graphql";
|
|
3
3
|
import type { ApolloCache } from "@apollo/client/cache";
|
|
4
|
+
import type { IgnoreModifier } from "@apollo/client/cache";
|
|
4
5
|
import type { Unmasked } from "@apollo/client/masking";
|
|
5
6
|
import type { DeepPartial } from "@apollo/client/utilities";
|
|
6
7
|
import type { NoInfer, VariablesOption } from "@apollo/client/utilities/internal";
|
|
7
|
-
import type { IgnoreModifier } from "../cache/core/types/common.cjs";
|
|
8
8
|
import type { ObservableQuery } from "./ObservableQuery.cjs";
|
|
9
9
|
import type { DefaultContext, InternalRefetchQueriesInclude, MutationQueryReducersMap, MutationUpdaterFunction, NormalizedExecutionResult, OnQueryUpdated, OperationVariables } from "./types.cjs";
|
|
10
10
|
/**
|
|
@@ -205,19 +205,19 @@ export interface UpdateQueryMapFn<TData = unknown, TVariables = OperationVariabl
|
|
|
205
205
|
(
|
|
206
206
|
/**
|
|
207
207
|
* @deprecated This value is not type-safe and may contain partial data. This
|
|
208
|
-
* argument will be removed in
|
|
209
|
-
*
|
|
208
|
+
* argument will be removed in Apollo Client v5. Use `options.previousData`
|
|
209
|
+
* instead for a more type-safe value.
|
|
210
210
|
*/
|
|
211
|
-
unsafePreviousData: Unmasked<TData
|
|
211
|
+
unsafePreviousData: DeepPartial<Unmasked<TData>>, options: UpdateQueryOptions<TData, TVariables>): Unmasked<TData> | void;
|
|
212
212
|
}
|
|
213
213
|
export type SubscribeToMoreUpdateQueryFn<TData = unknown, TVariables extends OperationVariables = OperationVariables, TSubscriptionData = TData> = {
|
|
214
214
|
(
|
|
215
215
|
/**
|
|
216
216
|
* @deprecated This value is not type-safe and may contain partial data. This
|
|
217
|
-
* argument will be removed in
|
|
218
|
-
*
|
|
217
|
+
* argument will be removed in Apollo Client v5. Use `options.previousData`
|
|
218
|
+
* instead for a more type-safe value.
|
|
219
219
|
*/
|
|
220
|
-
unsafePreviousData: Unmasked<TData
|
|
220
|
+
unsafePreviousData: DeepPartial<Unmasked<TData>>, options: UpdateQueryOptions<TData, TVariables> & {
|
|
221
221
|
subscriptionData: {
|
|
222
222
|
data: Unmasked<TSubscriptionData>;
|
|
223
223
|
};
|
|
@@ -8,7 +8,7 @@ class NotImplementedHandler {
|
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
10
10
|
prepareRequest(request) {
|
|
11
|
-
(0, invariant_1.invariant)(!(0, internal_1.hasDirectives)(["defer"], request.query),
|
|
11
|
+
(0, invariant_1.invariant)(!(0, internal_1.hasDirectives)(["defer"], request.query), 65);
|
|
12
12
|
return request;
|
|
13
13
|
}
|
|
14
14
|
extractErrors() { }
|
|
@@ -280,29 +280,29 @@ you have an infinite render loop in your application.`
|
|
|
280
280
|
message: "No fragment named %s"
|
|
281
281
|
},
|
|
282
282
|
|
|
283
|
-
|
|
283
|
+
54: {
|
|
284
284
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
285
285
|
message: "Could not resolve __typename on object %o returned from resolver '%s'. '__typename' needs to be returned to properly resolve child fields."
|
|
286
286
|
},
|
|
287
287
|
|
|
288
|
-
|
|
288
|
+
55: {
|
|
289
289
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
290
290
|
condition: "fragment",
|
|
291
291
|
message: `No fragment named %s`
|
|
292
292
|
},
|
|
293
293
|
|
|
294
|
-
|
|
294
|
+
56: {
|
|
295
295
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
296
296
|
condition: "cache.fragmentMatches",
|
|
297
297
|
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`."
|
|
298
298
|
},
|
|
299
299
|
|
|
300
|
-
|
|
300
|
+
57: {
|
|
301
301
|
file: "@apollo/client/__cjs/link/utils/validateOperation.cjs",
|
|
302
302
|
message: `illegal argument: %s`
|
|
303
303
|
},
|
|
304
304
|
|
|
305
|
-
|
|
305
|
+
58: {
|
|
306
306
|
file: "@apollo/client/__cjs/link/persisted-queries/index.cjs",
|
|
307
307
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
308
308
|
|
|
@@ -311,13 +311,13 @@ you have an infinite render loop in your application.`
|
|
|
311
311
|
"parameter."
|
|
312
312
|
},
|
|
313
313
|
|
|
314
|
-
|
|
314
|
+
59: {
|
|
315
315
|
file: "@apollo/client/__cjs/link/persisted-queries/index.cjs",
|
|
316
316
|
condition: "forward",
|
|
317
317
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
318
318
|
},
|
|
319
319
|
|
|
320
|
-
|
|
320
|
+
60: {
|
|
321
321
|
file: "@apollo/client/__cjs/link/http/checkFetcher.cjs",
|
|
322
322
|
condition: "fetcher || typeof fetch !== \"undefined\"",
|
|
323
323
|
|
|
@@ -335,29 +335,29 @@ const client = new ApolloClient({
|
|
|
335
335
|
`
|
|
336
336
|
},
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
61: {
|
|
339
339
|
file: "@apollo/client/__cjs/link/http/parseAndCheckHttpResponse.cjs",
|
|
340
340
|
condition: "response.body && typeof response.body.getReader === \"function\"",
|
|
341
341
|
message: "Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`."
|
|
342
342
|
},
|
|
343
343
|
|
|
344
|
-
|
|
344
|
+
62: {
|
|
345
345
|
file: "@apollo/client/__cjs/link/http/serializeFetchParameter.cjs",
|
|
346
346
|
message: `Network request failed. %s is not serializable: %s`
|
|
347
347
|
},
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
64: {
|
|
350
350
|
file: "@apollo/client/__cjs/link/core/ApolloLink.cjs",
|
|
351
351
|
message: "request is not implemented"
|
|
352
352
|
},
|
|
353
353
|
|
|
354
|
-
|
|
354
|
+
65: {
|
|
355
355
|
file: "@apollo/client/__cjs/incremental/handlers/notImplemented.cjs",
|
|
356
356
|
condition: "!(0, internal_1.hasDirectives)([\"defer\"], request.query)",
|
|
357
357
|
message: "`@defer` is not supported without specifying an incremental handler. Please pass a handler as the `incrementalHandler` option to the `ApolloClient` constructor."
|
|
358
358
|
},
|
|
359
359
|
|
|
360
|
-
|
|
360
|
+
66: {
|
|
361
361
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
362
362
|
condition: "options.cache",
|
|
363
363
|
|
|
@@ -366,7 +366,7 @@ const client = new ApolloClient({
|
|
|
366
366
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
367
367
|
},
|
|
368
368
|
|
|
369
|
-
|
|
369
|
+
67: {
|
|
370
370
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
371
371
|
condition: "options.link",
|
|
372
372
|
|
|
@@ -375,7 +375,7 @@ const client = new ApolloClient({
|
|
|
375
375
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
376
376
|
},
|
|
377
377
|
|
|
378
|
-
|
|
378
|
+
68: {
|
|
379
379
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
380
380
|
condition: "options.fetchPolicy !== \"cache-and-network\"",
|
|
381
381
|
|
|
@@ -385,7 +385,7 @@ const client = new ApolloClient({
|
|
|
385
385
|
"using a different fetchPolicy, such as cache-first or network-only."
|
|
386
386
|
},
|
|
387
387
|
|
|
388
|
-
|
|
388
|
+
69: {
|
|
389
389
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
390
390
|
condition: "options.fetchPolicy !== \"standby\"",
|
|
391
391
|
|
|
@@ -394,7 +394,7 @@ const client = new ApolloClient({
|
|
|
394
394
|
"as cache-first or network-only."
|
|
395
395
|
},
|
|
396
396
|
|
|
397
|
-
|
|
397
|
+
70: {
|
|
398
398
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
399
399
|
condition: "options.query",
|
|
400
400
|
|
|
@@ -402,158 +402,158 @@ const client = new ApolloClient({
|
|
|
402
402
|
"in the query option."
|
|
403
403
|
},
|
|
404
404
|
|
|
405
|
-
|
|
405
|
+
71: {
|
|
406
406
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
407
407
|
condition: "options.query.kind === \"Document\"",
|
|
408
408
|
message: 'You must wrap the query string in a "gql" tag.'
|
|
409
409
|
},
|
|
410
410
|
|
|
411
|
-
|
|
411
|
+
72: {
|
|
412
412
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
413
413
|
condition: "!options.returnPartialData",
|
|
414
414
|
message: "returnPartialData option only supported on watchQuery."
|
|
415
415
|
},
|
|
416
416
|
|
|
417
|
-
|
|
417
|
+
73: {
|
|
418
418
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
419
419
|
condition: "!options.pollInterval",
|
|
420
420
|
message: "pollInterval option only supported on watchQuery."
|
|
421
421
|
},
|
|
422
422
|
|
|
423
|
-
|
|
423
|
+
74: {
|
|
424
424
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
425
425
|
condition: "!options.notifyOnNetworkStatusChange",
|
|
426
426
|
message: "notifyOnNetworkStatusChange option only supported on watchQuery."
|
|
427
427
|
},
|
|
428
428
|
|
|
429
|
-
|
|
429
|
+
75: {
|
|
430
430
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
431
431
|
condition: "optionsWithDefaults.mutation",
|
|
432
432
|
message: "The `mutation` option is required. Please provide a GraphQL document in the `mutation` option."
|
|
433
433
|
},
|
|
434
434
|
|
|
435
|
-
|
|
435
|
+
76: {
|
|
436
436
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
437
437
|
condition: "optionsWithDefaults.fetchPolicy === \"network-only\" ||\n optionsWithDefaults.fetchPolicy === \"no-cache\"",
|
|
438
438
|
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."
|
|
439
439
|
},
|
|
440
440
|
|
|
441
|
-
|
|
441
|
+
79: {
|
|
442
442
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
443
443
|
condition: "this.options.fetchPolicy !== \"cache-only\"",
|
|
444
444
|
message: "Cannot execute `fetchMore` for 'cache-only' query '%s'. Please use a different fetch policy."
|
|
445
445
|
},
|
|
446
446
|
|
|
447
|
-
|
|
447
|
+
80: {
|
|
448
448
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
449
449
|
condition: "updateQuery",
|
|
450
450
|
message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
|
|
451
451
|
},
|
|
452
452
|
|
|
453
|
-
|
|
453
|
+
84: {
|
|
454
454
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
455
455
|
message: "QueryManager stopped while query was in flight"
|
|
456
456
|
},
|
|
457
457
|
|
|
458
|
-
|
|
458
|
+
85: {
|
|
459
459
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
460
460
|
condition: "this.localState",
|
|
461
461
|
message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
462
462
|
},
|
|
463
463
|
|
|
464
|
-
|
|
464
|
+
86: {
|
|
465
465
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
466
466
|
message: "Store reset while query was in flight (not completed in link chain)"
|
|
467
467
|
},
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
89: {
|
|
470
470
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
471
471
|
condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
|
|
472
472
|
message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
473
473
|
},
|
|
474
474
|
|
|
475
|
-
|
|
475
|
+
90: {
|
|
476
476
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
477
477
|
condition: "this.localState",
|
|
478
478
|
message: "%s '%s' contains `@client` fields but local state has not been configured."
|
|
479
479
|
},
|
|
480
480
|
|
|
481
|
-
|
|
481
|
+
91: {
|
|
482
482
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
483
483
|
condition: "!hasIncrementalDirective",
|
|
484
484
|
message: "%s '%s' contains `@client` and `@defer` directives. These cannot be used together."
|
|
485
485
|
},
|
|
486
486
|
|
|
487
|
-
|
|
487
|
+
92: {
|
|
488
488
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
489
489
|
condition: "this.localState",
|
|
490
490
|
message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
491
491
|
},
|
|
492
492
|
|
|
493
|
-
|
|
493
|
+
94: {
|
|
494
494
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
495
495
|
condition: "this.localState",
|
|
496
496
|
message: "Query '%s' contains `@client` fields but local state has not been configured."
|
|
497
497
|
},
|
|
498
498
|
|
|
499
|
-
|
|
499
|
+
95: {
|
|
500
500
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
501
501
|
condition: "didEmitValue",
|
|
502
502
|
message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
|
|
503
503
|
},
|
|
504
504
|
|
|
505
|
-
|
|
505
|
+
96: {
|
|
506
506
|
file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
|
|
507
507
|
condition: "typeof dataId === \"string\"",
|
|
508
508
|
message: "store.merge expects a string ID"
|
|
509
509
|
},
|
|
510
510
|
|
|
511
|
-
|
|
511
|
+
99: {
|
|
512
512
|
file: "@apollo/client/__cjs/cache/inmemory/key-extractor.cjs",
|
|
513
513
|
condition: "extracted !== void 0",
|
|
514
514
|
message: `Missing field '%s' while extracting keyFields from %s`
|
|
515
515
|
},
|
|
516
516
|
|
|
517
|
-
|
|
517
|
+
100: {
|
|
518
518
|
file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
|
|
519
519
|
condition: "!old || old === which",
|
|
520
520
|
message: `Cannot change root %s __typename more than once`
|
|
521
521
|
},
|
|
522
522
|
|
|
523
|
-
|
|
523
|
+
103: {
|
|
524
524
|
file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
|
|
525
525
|
message: "Cannot automatically merge arrays"
|
|
526
526
|
},
|
|
527
527
|
|
|
528
|
-
|
|
528
|
+
104: {
|
|
529
529
|
file: "@apollo/client/__cjs/cache/inmemory/readFromStore.cjs",
|
|
530
530
|
message: `No fragment named %s`
|
|
531
531
|
},
|
|
532
532
|
|
|
533
|
-
|
|
533
|
+
105: {
|
|
534
534
|
file: "@apollo/client/__cjs/cache/inmemory/readFromStore.cjs",
|
|
535
535
|
condition: "!(0, utilities_1.isReference)(value)",
|
|
536
536
|
message: `Missing selection set for object of type %s returned for query field %s`
|
|
537
537
|
},
|
|
538
538
|
|
|
539
|
-
|
|
539
|
+
106: {
|
|
540
540
|
file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
|
|
541
541
|
message: `Could not identify object %s`
|
|
542
542
|
},
|
|
543
543
|
|
|
544
|
-
|
|
544
|
+
108: {
|
|
545
545
|
file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
|
|
546
546
|
message: `No fragment named %s`
|
|
547
547
|
}
|
|
548
548
|
};
|
|
549
549
|
|
|
550
550
|
export const devDebug = {
|
|
551
|
-
|
|
551
|
+
77: {
|
|
552
552
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
553
553
|
message: `In client.refetchQueries, Promise.all promise rejected with error %o`
|
|
554
554
|
},
|
|
555
555
|
|
|
556
|
-
|
|
556
|
+
83: {
|
|
557
557
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
558
558
|
message: `Missing cache result fields: %o`
|
|
559
559
|
}
|
|
@@ -588,58 +588,53 @@ export const devWarn = {
|
|
|
588
588
|
},
|
|
589
589
|
|
|
590
590
|
51: {
|
|
591
|
-
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
592
|
-
message: "Could not find a resolver for the '%s' field. The field value has been set to `null`."
|
|
593
|
-
},
|
|
594
|
-
|
|
595
|
-
52: {
|
|
596
591
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
597
592
|
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."
|
|
598
593
|
},
|
|
599
594
|
|
|
600
|
-
|
|
595
|
+
52: {
|
|
601
596
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
602
597
|
message: "The '%s' field had no cached value and only forced resolvers were run. The value was set to `null`."
|
|
603
598
|
},
|
|
604
599
|
|
|
605
|
-
|
|
600
|
+
53: {
|
|
606
601
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
607
602
|
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."
|
|
608
603
|
},
|
|
609
604
|
|
|
610
|
-
|
|
605
|
+
63: {
|
|
611
606
|
file: "@apollo/client/__cjs/link/core/ApolloLink.cjs",
|
|
612
607
|
message: `You are calling concat on a terminating link, which will have no effect %o`
|
|
613
608
|
},
|
|
614
609
|
|
|
615
|
-
|
|
610
|
+
78: {
|
|
616
611
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
617
612
|
|
|
618
613
|
message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
|
|
619
614
|
Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
620
615
|
},
|
|
621
616
|
|
|
622
|
-
|
|
617
|
+
82: {
|
|
623
618
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
624
619
|
message: "Cannot poll on 'cache-only' query '%s' and as such, polling is disabled. Please use a different fetch policy."
|
|
625
620
|
},
|
|
626
621
|
|
|
627
|
-
|
|
622
|
+
87: {
|
|
628
623
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
629
624
|
message: `Unknown query named "%s" requested in refetchQueries options.include array`
|
|
630
625
|
},
|
|
631
626
|
|
|
632
|
-
|
|
627
|
+
88: {
|
|
633
628
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
634
629
|
message: `Unknown anonymous query requested in refetchQueries options.include array`
|
|
635
630
|
},
|
|
636
631
|
|
|
637
|
-
|
|
632
|
+
93: {
|
|
638
633
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
639
634
|
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.'
|
|
640
635
|
},
|
|
641
636
|
|
|
642
|
-
|
|
637
|
+
97: {
|
|
643
638
|
file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
|
|
644
639
|
|
|
645
640
|
message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
|
|
@@ -647,24 +642,24 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
|
647
642
|
"`toReference(object, true)`"
|
|
648
643
|
},
|
|
649
644
|
|
|
650
|
-
|
|
645
|
+
98: {
|
|
651
646
|
file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
|
|
652
647
|
|
|
653
648
|
message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
|
|
654
649
|
"Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
|
|
655
650
|
},
|
|
656
651
|
|
|
657
|
-
|
|
652
|
+
101: {
|
|
658
653
|
file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
|
|
659
654
|
message: `Inferring subtype %s of supertype %s`
|
|
660
655
|
},
|
|
661
656
|
|
|
662
|
-
|
|
657
|
+
102: {
|
|
663
658
|
file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
|
|
664
659
|
message: `Undefined 'from' passed to readField with arguments %s`
|
|
665
660
|
},
|
|
666
661
|
|
|
667
|
-
|
|
662
|
+
109: {
|
|
668
663
|
file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
|
|
669
664
|
|
|
670
665
|
message: `Cache data may be lost when replacing the %s field of a %s object.
|
|
@@ -683,7 +678,7 @@ For more information about these options, please refer to the documentation:
|
|
|
683
678
|
`
|
|
684
679
|
},
|
|
685
680
|
|
|
686
|
-
|
|
681
|
+
110: {
|
|
687
682
|
file: "@apollo/client/__cjs/cache/core/cache.cjs",
|
|
688
683
|
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."
|
|
689
684
|
}
|
|
@@ -700,12 +695,12 @@ export const devError = {
|
|
|
700
695
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
701
696
|
},
|
|
702
697
|
|
|
703
|
-
|
|
698
|
+
81: {
|
|
704
699
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
705
700
|
message: "Unhandled GraphQL subscription error"
|
|
706
701
|
},
|
|
707
702
|
|
|
708
|
-
|
|
703
|
+
107: {
|
|
709
704
|
file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
|
|
710
705
|
message: `Missing field '%s' while writing result %o`
|
|
711
706
|
}
|
|
@@ -52,7 +52,7 @@ class ApolloLink {
|
|
|
52
52
|
static concat(first, second) {
|
|
53
53
|
const firstLink = toLink(first);
|
|
54
54
|
if (isTerminating(firstLink)) {
|
|
55
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
55
|
+
__DEV__ && invariant_1.invariant.warn(63, firstLink);
|
|
56
56
|
return firstLink;
|
|
57
57
|
}
|
|
58
58
|
const nextLink = toLink(second);
|
|
@@ -81,7 +81,7 @@ class ApolloLink {
|
|
|
81
81
|
return ApolloLink.concat(this, next);
|
|
82
82
|
}
|
|
83
83
|
request(operation, forward) {
|
|
84
|
-
throw (0, invariant_1.newInvariantError)(
|
|
84
|
+
throw (0, invariant_1.newInvariantError)(64);
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* @internal
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FormattedExecutionResult, GraphQLFormattedError } from "graphql";
|
|
1
|
+
import type { FormattedExecutionResult, GraphQLFormattedError, OperationTypeNode } from "graphql";
|
|
2
2
|
import type { DocumentNode } from "graphql";
|
|
3
3
|
import type { Observable } from "rxjs";
|
|
4
4
|
import type { ApolloClient, DefaultContext } from "@apollo/client";
|
|
@@ -11,6 +11,7 @@ export interface GraphQLRequest<TVariables = Record<string, any>> {
|
|
|
11
11
|
query: DocumentNode;
|
|
12
12
|
variables?: TVariables;
|
|
13
13
|
operationName?: string;
|
|
14
|
+
operationType?: OperationTypeNode;
|
|
14
15
|
context?: DefaultContext;
|
|
15
16
|
extensions?: Record<string, any>;
|
|
16
17
|
}
|
|
@@ -18,6 +19,7 @@ export interface Operation {
|
|
|
18
19
|
query: DocumentNode;
|
|
19
20
|
variables: Record<string, any>;
|
|
20
21
|
operationName: string;
|
|
22
|
+
operationType: OperationTypeNode | undefined;
|
|
21
23
|
extensions: Record<string, any>;
|
|
22
24
|
setContext: {
|
|
23
25
|
(context: Partial<OperationContext>): void;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.checkFetcher = void 0;
|
|
4
4
|
const invariant_1 = require("@apollo/client/utilities/invariant");
|
|
5
5
|
const checkFetcher = (fetcher) => {
|
|
6
|
-
(0, invariant_1.invariant)(fetcher || typeof fetch !== "undefined",
|
|
6
|
+
(0, invariant_1.invariant)(fetcher || typeof fetch !== "undefined", 60);
|
|
7
7
|
};
|
|
8
8
|
exports.checkFetcher = checkFetcher;
|
|
9
9
|
//# sourceMappingURL=checkFetcher.cjs.map
|
|
@@ -37,7 +37,7 @@ async function* consumeMultipartBody(response) {
|
|
|
37
37
|
/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i);
|
|
38
38
|
const boundary = "\r\n--" + (match?.findLast((val) => !!val) || "-");
|
|
39
39
|
let buffer = "";
|
|
40
|
-
(0, invariant_1.invariant)(response.body && typeof response.body.getReader === "function",
|
|
40
|
+
(0, invariant_1.invariant)(response.body && typeof response.body.getReader === "function", 61);
|
|
41
41
|
const reader = response.body.getReader();
|
|
42
42
|
let done = false;
|
|
43
43
|
let value;
|
|
@@ -8,7 +8,7 @@ const serializeFetchParameter = (p, label) => {
|
|
|
8
8
|
serialized = JSON.stringify(p);
|
|
9
9
|
}
|
|
10
10
|
catch (e) {
|
|
11
|
-
const parseError = (0, invariant_1.newInvariantError)(
|
|
11
|
+
const parseError = (0, invariant_1.newInvariantError)(62, label, e.message);
|
|
12
12
|
parseError.parseError = e;
|
|
13
13
|
throw parseError;
|
|
14
14
|
}
|
|
@@ -54,7 +54,7 @@ class PersistedQueryLink extends link_1.ApolloLink {
|
|
|
54
54
|
// hashing with something other than SHA-256.
|
|
55
55
|
(0, invariant_1.invariant)(options &&
|
|
56
56
|
(typeof options.sha256 === "function" ||
|
|
57
|
-
typeof options.generateHash === "function"),
|
|
57
|
+
typeof options.generateHash === "function"), 58);
|
|
58
58
|
const { sha256,
|
|
59
59
|
// If both a `sha256` and `generateHash` option are provided, the
|
|
60
60
|
// `sha256` option will be ignored. Developers can configure and
|
|
@@ -80,7 +80,7 @@ class PersistedQueryLink extends link_1.ApolloLink {
|
|
|
80
80
|
return hash;
|
|
81
81
|
}
|
|
82
82
|
super((operation, forward) => {
|
|
83
|
-
(0, invariant_1.invariant)(forward,
|
|
83
|
+
(0, invariant_1.invariant)(forward, 59);
|
|
84
84
|
const { query } = operation;
|
|
85
85
|
return new rxjs_1.Observable((observer) => {
|
|
86
86
|
let subscription;
|
|
@@ -6,13 +6,14 @@ function validateOperation(operation) {
|
|
|
6
6
|
const OPERATION_FIELDS = [
|
|
7
7
|
"query",
|
|
8
8
|
"operationName",
|
|
9
|
+
"operationType",
|
|
9
10
|
"variables",
|
|
10
11
|
"extensions",
|
|
11
12
|
"context",
|
|
12
13
|
];
|
|
13
14
|
for (let key of Object.keys(operation)) {
|
|
14
15
|
if (OPERATION_FIELDS.indexOf(key) < 0) {
|
|
15
|
-
throw (0, invariant_1.newInvariantError)(
|
|
16
|
+
throw (0, invariant_1.newInvariantError)(57, key);
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
return operation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateOperation.cjs","sources":["../../../../src/link/utils/validateOperation.ts"],"sourcesContent":["import type { GraphQLRequest } from \"@apollo/client/link\";\nimport { newInvariantError } from \"@apollo/client/utilities/invariant\";\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n \"query\",\n \"operationName\",\n \"variables\",\n \"extensions\",\n \"context\",\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw newInvariantError(`illegal argument: %s`, key);\n }\n }\n\n return operation;\n}\n"],"names":[],"mappings":";;AAGA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAFA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAgB,CAAhB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkC,CAAlC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;IACE,CAAF,CAAA,CAAA,CAAA,EAAQ,CAAR,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAA2B;QACvB,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW;QACP,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB;QACf,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe;QACX,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB;QACZ,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa;IACb,CAAG;IACD,CAAF,CAAA,EAAA,CAAO,CAAP,CAAA,EAAW,CAAX,CAAA,EAAA,CAAA,EAAkB,CAAlB,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAzB,CAAA,CAAA,CAA6B,CAAC,CAA9B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuC,CAAC,EAAE;QACtC,CAAJ,EAAA,CAAQ,CAAR,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgC,CAAC,CAAjC,CAAA,CAAoC,EAApC,EAAwC,CAAC,EAAE;YACrC,CAAN,CAAA,CAAA,CAAA,GAAA,GAAY,CAAZ,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,OAAsD,CAAtD,CAAA,EAA0D;QACtD;IACF;IAEA,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB;AAClB;"}
|
|
1
|
+
{"version":3,"file":"validateOperation.cjs","sources":["../../../../src/link/utils/validateOperation.ts"],"sourcesContent":["import type { GraphQLRequest } from \"@apollo/client/link\";\nimport { newInvariantError } from \"@apollo/client/utilities/invariant\";\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n \"query\",\n \"operationName\",\n \"operationType\",\n \"variables\",\n \"extensions\",\n \"context\",\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw newInvariantError(`illegal argument: %s`, key);\n }\n }\n\n return operation;\n}\n"],"names":[],"mappings":";;AAGA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAFA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAgB,CAAhB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkC,CAAlC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;IACE,CAAF,CAAA,CAAA,CAAA,EAAQ,CAAR,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAA2B;QACvB,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW;QACP,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB;QACf,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB;QACf,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe;QACX,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB;QACZ,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa;IACb,CAAG;IACD,CAAF,CAAA,EAAA,CAAO,CAAP,CAAA,EAAW,CAAX,CAAA,EAAA,CAAA,EAAkB,CAAlB,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAzB,CAAA,CAAA,CAA6B,CAAC,CAA9B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuC,CAAC,EAAE;QACtC,CAAJ,EAAA,CAAQ,CAAR,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgC,CAAC,CAAjC,CAAA,CAAoC,EAApC,EAAwC,CAAC,EAAE;YACrC,CAAN,CAAA,CAAA,CAAA,GAAA,GAAY,CAAZ,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,OAAsD,CAAtD,CAAA,EAA0D;QACtD;IACF;IAEA,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB;AAClB;"}
|
|
@@ -225,9 +225,6 @@ class LocalState {
|
|
|
225
225
|
return fieldFromCache;
|
|
226
226
|
}
|
|
227
227
|
if (!returnPartialData) {
|
|
228
|
-
if (environment_1.__DEV__) {
|
|
229
|
-
__DEV__ && invariant_1.invariant.warn(51, resolverName);
|
|
230
|
-
}
|
|
231
228
|
return null;
|
|
232
229
|
}
|
|
233
230
|
});
|
|
@@ -293,13 +290,13 @@ class LocalState {
|
|
|
293
290
|
if (result === undefined && !returnPartialData) {
|
|
294
291
|
if (environment_1.__DEV__ && phase === "resolve") {
|
|
295
292
|
if (resolver && !onlyRunForcedResolvers) {
|
|
296
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
293
|
+
__DEV__ && invariant_1.invariant.warn(51, resolverName);
|
|
297
294
|
}
|
|
298
295
|
else if (onlyRunForcedResolvers) {
|
|
299
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
296
|
+
__DEV__ && invariant_1.invariant.warn(52, resolverName);
|
|
300
297
|
}
|
|
301
298
|
else {
|
|
302
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
299
|
+
__DEV__ && invariant_1.invariant.warn(53, fieldName, rootValue);
|
|
303
300
|
}
|
|
304
301
|
}
|
|
305
302
|
result = null;
|
|
@@ -311,7 +308,7 @@ class LocalState {
|
|
|
311
308
|
return this.resolveSubSelectedArray(field, true, result, execContext, path);
|
|
312
309
|
}
|
|
313
310
|
if (phase === "resolve" && !result.__typename) {
|
|
314
|
-
this.addError((0, invariant_1.newInvariantError)(
|
|
311
|
+
this.addError((0, invariant_1.newInvariantError)(54, result, resolverName), path, execContext, { resolver: resolverName });
|
|
315
312
|
return null;
|
|
316
313
|
}
|
|
317
314
|
return this.resolveSelectionSet(field.selectionSet, true, result, execContext, path);
|
|
@@ -422,7 +419,7 @@ class LocalState {
|
|
|
422
419
|
},
|
|
423
420
|
FragmentSpread(spread, _, __, ___, ancestors) {
|
|
424
421
|
const fragment = fragmentMap[spread.name.value];
|
|
425
|
-
(0, invariant_1.invariant)(fragment,
|
|
422
|
+
(0, invariant_1.invariant)(fragment, 55, spread.name.value);
|
|
426
423
|
const { selectionsToResolve: fragmentSelections } = traverse(fragment);
|
|
427
424
|
if (fragmentSelections.size > 0) {
|
|
428
425
|
// Fragment for this spread contains @client directive (either directly or transitively)
|
|
@@ -482,7 +479,7 @@ function getExportedVariableName(directive) {
|
|
|
482
479
|
}
|
|
483
480
|
}
|
|
484
481
|
function validateCacheImplementation(cache) {
|
|
485
|
-
(0, invariant_1.invariant)(cache.fragmentMatches,
|
|
482
|
+
(0, invariant_1.invariant)(cache.fragmentMatches, 56);
|
|
486
483
|
}
|
|
487
484
|
function getCacheResultAtPath(diff, path) {
|
|
488
485
|
if (diff.result === null) {
|