@apollo/client 4.0.9 → 4.0.13
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 +39 -0
- package/__cjs/cache/core/cache.cjs +49 -6
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +47 -0
- package/__cjs/cache/core/types/Cache.d.cts +28 -0
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- package/__cjs/cache/inmemory/fragmentRegistry.cjs +5 -0
- package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs +47 -0
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +47 -0
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +4 -4
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +16 -1
- package/__cjs/core/ObservableQuery.cjs +18 -7
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +1 -0
- package/__cjs/core/QueryManager.cjs +13 -13
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/invariantErrorCodes.cjs +39 -33
- package/__cjs/link/error/index.cjs +1 -1
- package/__cjs/link/error/index.cjs.map +1 -1
- package/__cjs/link/error/index.d.cts +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +51 -50
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +3 -0
- package/__cjs/link/schema/index.cjs +1 -1
- package/__cjs/link/schema/index.cjs.map +1 -1
- package/__cjs/link/schema/index.d.cts +1 -1
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
- package/__cjs/react/hooks/useApolloClient.d.cts +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +1 -0
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.cjs +7 -4
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs +2 -0
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/utilities/internal/bindCacheKey.cjs +21 -0
- package/__cjs/utilities/internal/bindCacheKey.cjs.map +1 -0
- package/__cjs/utilities/internal/bindCacheKey.d.cts +15 -0
- package/__cjs/utilities/internal/checkDocument.cjs +2 -4
- package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
- package/__cjs/utilities/internal/compact.cjs +1 -1
- package/__cjs/utilities/internal/compact.cjs.map +1 -1
- package/__cjs/utilities/internal/constants.cjs +13 -0
- package/__cjs/utilities/internal/constants.cjs.map +1 -0
- package/__cjs/utilities/internal/constants.d.cts +10 -0
- package/__cjs/utilities/internal/index.cjs +6 -2
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +2 -0
- package/__cjs/utilities/internal/memoize.cjs +31 -0
- package/__cjs/utilities/internal/memoize.cjs.map +1 -0
- package/__cjs/utilities/internal/memoize.d.cts +7 -0
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.cjs.map +1 -1
- package/cache/core/cache.d.ts +47 -0
- package/cache/core/cache.js +50 -7
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +28 -0
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/fragmentRegistry.js +6 -1
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +47 -0
- package/cache/inmemory/inMemoryCache.js +47 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.d.ts +16 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +1 -0
- package/core/ObservableQuery.js +19 -8
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.js +13 -13
- package/core/QueryManager.js.map +1 -1
- package/invariantErrorCodes.js +39 -33
- package/link/error/index.d.ts +1 -1
- package/link/error/index.js +1 -1
- package/link/error/index.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/remove-typename/removeTypenameFromVariables.d.ts +3 -0
- package/link/remove-typename/removeTypenameFromVariables.js +51 -50
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
- package/link/schema/index.d.ts +1 -1
- package/link/schema/index.js +1 -1
- package/link/schema/index.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useApolloClient.d.ts +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useLazyQuery.js +2 -1
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useQuery.js +8 -5
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSuspenseQuery.js +2 -0
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks-compiled/useApolloClient.d.ts +1 -1
- package/react/hooks-compiled/useApolloClient.js +1 -1
- package/react/hooks-compiled/useApolloClient.js.map +1 -1
- package/react/hooks-compiled/useLazyQuery.js +2 -1
- package/react/hooks-compiled/useLazyQuery.js.map +1 -1
- package/react/hooks-compiled/useQuery.js +9 -5
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/react/hooks-compiled/useSuspenseQuery.js +3 -1
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
- package/utilities/internal/bindCacheKey.d.ts +15 -0
- package/utilities/internal/bindCacheKey.js +18 -0
- package/utilities/internal/bindCacheKey.js.map +1 -0
- package/utilities/internal/checkDocument.js +2 -4
- package/utilities/internal/checkDocument.js.map +1 -1
- package/utilities/internal/compact.js +1 -1
- package/utilities/internal/compact.js.map +1 -1
- package/utilities/internal/constants.d.ts +10 -0
- package/utilities/internal/constants.js +10 -0
- package/utilities/internal/constants.js.map +1 -0
- package/utilities/internal/index.d.ts +2 -0
- package/utilities/internal/index.js +2 -0
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/memoize.d.ts +7 -0
- package/utilities/internal/memoize.js +28 -0
- package/utilities/internal/memoize.js.map +1 -0
- package/version.js +1 -1
- package/version.js.map +1 -1
package/invariantErrorCodes.js
CHANGED
|
@@ -420,110 +420,116 @@ const client = new ApolloClient({
|
|
|
420
420
|
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."
|
|
421
421
|
},
|
|
422
422
|
|
|
423
|
-
|
|
423
|
+
77: {
|
|
424
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
425
|
+
condition: "fetchPolicy === \"standby\"",
|
|
426
|
+
message: "The `variablesUnknown` option can only be used together with a `standby` fetch policy."
|
|
427
|
+
},
|
|
428
|
+
|
|
429
|
+
79: {
|
|
424
430
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
425
431
|
condition: "this.options.fetchPolicy !== \"cache-only\"",
|
|
426
432
|
message: "Cannot execute `fetchMore` for 'cache-only' query '%s'. Please use a different fetch policy."
|
|
427
433
|
},
|
|
428
434
|
|
|
429
|
-
|
|
435
|
+
80: {
|
|
430
436
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
431
437
|
condition: "updateQuery",
|
|
432
438
|
message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
|
|
433
439
|
},
|
|
434
440
|
|
|
435
|
-
|
|
441
|
+
84: {
|
|
436
442
|
file: "@apollo/client/core/QueryManager.js",
|
|
437
443
|
message: "QueryManager stopped while query was in flight"
|
|
438
444
|
},
|
|
439
445
|
|
|
440
|
-
|
|
446
|
+
85: {
|
|
441
447
|
file: "@apollo/client/core/QueryManager.js",
|
|
442
448
|
condition: "this.localState",
|
|
443
449
|
message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
444
450
|
},
|
|
445
451
|
|
|
446
|
-
|
|
452
|
+
86: {
|
|
447
453
|
file: "@apollo/client/core/QueryManager.js",
|
|
448
454
|
message: "Store reset while query was in flight (not completed in link chain)"
|
|
449
455
|
},
|
|
450
456
|
|
|
451
|
-
|
|
457
|
+
89: {
|
|
452
458
|
file: "@apollo/client/core/QueryManager.js",
|
|
453
459
|
condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
|
|
454
460
|
message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
455
461
|
},
|
|
456
462
|
|
|
457
|
-
|
|
463
|
+
90: {
|
|
458
464
|
file: "@apollo/client/core/QueryManager.js",
|
|
459
465
|
condition: "this.localState",
|
|
460
466
|
message: "%s '%s' contains `@client` fields but local state has not been configured."
|
|
461
467
|
},
|
|
462
468
|
|
|
463
|
-
|
|
469
|
+
91: {
|
|
464
470
|
file: "@apollo/client/core/QueryManager.js",
|
|
465
471
|
condition: "!hasIncrementalDirective",
|
|
466
472
|
message: "%s '%s' contains `@client` and `@defer` directives. These cannot be used together."
|
|
467
473
|
},
|
|
468
474
|
|
|
469
|
-
|
|
475
|
+
92: {
|
|
470
476
|
file: "@apollo/client/core/QueryManager.js",
|
|
471
477
|
condition: "this.localState",
|
|
472
478
|
message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
473
479
|
},
|
|
474
480
|
|
|
475
|
-
|
|
481
|
+
94: {
|
|
476
482
|
file: "@apollo/client/core/QueryManager.js",
|
|
477
483
|
condition: "this.localState",
|
|
478
484
|
message: "Query '%s' contains `@client` fields but local state has not been configured."
|
|
479
485
|
},
|
|
480
486
|
|
|
481
|
-
|
|
487
|
+
95: {
|
|
482
488
|
file: "@apollo/client/core/QueryManager.js",
|
|
483
489
|
condition: "didEmitValue",
|
|
484
490
|
message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
|
|
485
491
|
},
|
|
486
492
|
|
|
487
|
-
|
|
493
|
+
96: {
|
|
488
494
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
489
495
|
condition: "typeof dataId === \"string\"",
|
|
490
496
|
message: "store.merge expects a string ID"
|
|
491
497
|
},
|
|
492
498
|
|
|
493
|
-
|
|
499
|
+
99: {
|
|
494
500
|
file: "@apollo/client/cache/inmemory/key-extractor.js",
|
|
495
501
|
condition: "extracted !== void 0",
|
|
496
502
|
message: `Missing field '%s' while extracting keyFields from %s`
|
|
497
503
|
},
|
|
498
504
|
|
|
499
|
-
|
|
505
|
+
100: {
|
|
500
506
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
501
507
|
condition: "!old || old === which",
|
|
502
508
|
message: `Cannot change root %s __typename more than once`
|
|
503
509
|
},
|
|
504
510
|
|
|
505
|
-
|
|
511
|
+
103: {
|
|
506
512
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
507
513
|
message: "Cannot automatically merge arrays"
|
|
508
514
|
},
|
|
509
515
|
|
|
510
|
-
|
|
516
|
+
104: {
|
|
511
517
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
512
518
|
message: `No fragment named %s`
|
|
513
519
|
},
|
|
514
520
|
|
|
515
|
-
|
|
521
|
+
105: {
|
|
516
522
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
517
523
|
condition: "!isReference(value)",
|
|
518
524
|
message: `Missing selection set for object of type %s returned for query field %s`
|
|
519
525
|
},
|
|
520
526
|
|
|
521
|
-
|
|
527
|
+
106: {
|
|
522
528
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
523
529
|
message: `Could not identify object %s`
|
|
524
530
|
},
|
|
525
531
|
|
|
526
|
-
|
|
532
|
+
108: {
|
|
527
533
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
528
534
|
message: `No fragment named %s`
|
|
529
535
|
}
|
|
@@ -535,7 +541,7 @@ export const devDebug = {
|
|
|
535
541
|
message: `In client.refetchQueries, Promise.all promise rejected with error %o`
|
|
536
542
|
},
|
|
537
543
|
|
|
538
|
-
|
|
544
|
+
83: {
|
|
539
545
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
540
546
|
message: `Missing cache result fields: %o`
|
|
541
547
|
}
|
|
@@ -603,34 +609,34 @@ export const devWarn = {
|
|
|
603
609
|
"If you are using a split link, ensure each branch contains a terminating link that handles the request."
|
|
604
610
|
},
|
|
605
611
|
|
|
606
|
-
|
|
612
|
+
78: {
|
|
607
613
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
608
614
|
|
|
609
615
|
message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
|
|
610
616
|
Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
611
617
|
},
|
|
612
618
|
|
|
613
|
-
|
|
619
|
+
82: {
|
|
614
620
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
615
621
|
message: "Cannot poll on 'cache-only' query '%s' and as such, polling is disabled. Please use a different fetch policy."
|
|
616
622
|
},
|
|
617
623
|
|
|
618
|
-
|
|
624
|
+
87: {
|
|
619
625
|
file: "@apollo/client/core/QueryManager.js",
|
|
620
626
|
message: `Unknown query named "%s" requested in refetchQueries options.include array`
|
|
621
627
|
},
|
|
622
628
|
|
|
623
|
-
|
|
629
|
+
88: {
|
|
624
630
|
file: "@apollo/client/core/QueryManager.js",
|
|
625
631
|
message: `Unknown anonymous query requested in refetchQueries options.include array`
|
|
626
632
|
},
|
|
627
633
|
|
|
628
|
-
|
|
634
|
+
93: {
|
|
629
635
|
file: "@apollo/client/core/QueryManager.js",
|
|
630
636
|
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.'
|
|
631
637
|
},
|
|
632
638
|
|
|
633
|
-
|
|
639
|
+
97: {
|
|
634
640
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
635
641
|
|
|
636
642
|
message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
|
|
@@ -638,24 +644,24 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
|
638
644
|
"`toReference(object, true)`"
|
|
639
645
|
},
|
|
640
646
|
|
|
641
|
-
|
|
647
|
+
98: {
|
|
642
648
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
643
649
|
|
|
644
650
|
message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
|
|
645
651
|
"Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
|
|
646
652
|
},
|
|
647
653
|
|
|
648
|
-
|
|
654
|
+
101: {
|
|
649
655
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
650
656
|
message: `Inferring subtype %s of supertype %s`
|
|
651
657
|
},
|
|
652
658
|
|
|
653
|
-
|
|
659
|
+
102: {
|
|
654
660
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
655
661
|
message: `Undefined 'from' passed to readField with arguments %s`
|
|
656
662
|
},
|
|
657
663
|
|
|
658
|
-
|
|
664
|
+
109: {
|
|
659
665
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
660
666
|
|
|
661
667
|
message: `Cache data may be lost when replacing the %s field of a %s object.
|
|
@@ -674,7 +680,7 @@ For more information about these options, please refer to the documentation:
|
|
|
674
680
|
`
|
|
675
681
|
},
|
|
676
682
|
|
|
677
|
-
|
|
683
|
+
110: {
|
|
678
684
|
file: "@apollo/client/cache/core/cache.js",
|
|
679
685
|
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."
|
|
680
686
|
}
|
|
@@ -691,12 +697,12 @@ export const devError = {
|
|
|
691
697
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
692
698
|
},
|
|
693
699
|
|
|
694
|
-
|
|
700
|
+
81: {
|
|
695
701
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
696
702
|
message: "Unhandled GraphQL subscription error"
|
|
697
703
|
},
|
|
698
704
|
|
|
699
|
-
|
|
705
|
+
107: {
|
|
700
706
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
701
707
|
message: `Missing field '%s' while writing result %o`
|
|
702
708
|
}
|
package/link/error/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export declare function onError(errorHandler: ErrorLink.ErrorHandler): ErrorLink
|
|
|
62
62
|
* @remarks
|
|
63
63
|
*
|
|
64
64
|
* This link is used after the GraphQL operation completes and execution is
|
|
65
|
-
* moving back up your [link chain](https://apollographql.com/docs/react/introduction#handling-a-response). The `errorHandler` function should
|
|
65
|
+
* moving back up your [link chain](https://apollographql.com/docs/react/api/link/introduction#handling-a-response). The `errorHandler` function should
|
|
66
66
|
* not return a value unless you want to [retry the operation](https://apollographql.com/docs/react/data/error-handling#retrying-operations).
|
|
67
67
|
*
|
|
68
68
|
* For more information on the types of errors that might be encountered, see
|
package/link/error/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export function onError(errorHandler) {
|
|
|
15
15
|
* @remarks
|
|
16
16
|
*
|
|
17
17
|
* This link is used after the GraphQL operation completes and execution is
|
|
18
|
-
* moving back up your [link chain](https://apollographql.com/docs/react/introduction#handling-a-response). The `errorHandler` function should
|
|
18
|
+
* moving back up your [link chain](https://apollographql.com/docs/react/api/link/introduction#handling-a-response). The `errorHandler` function should
|
|
19
19
|
* not return a value unless you want to [retry the operation](https://apollographql.com/docs/react/data/error-handling#retrying-operations).
|
|
20
20
|
*
|
|
21
21
|
* For more information on the types of errors that might be encountered, see
|
package/link/error/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/error/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,sBAAsB,EACtB,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAsDjD;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,YAAoC;IAC1D,OAAO,IAAI,SAAS,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,SAAU,SAAQ,UAAU;IACvC,YAAY,YAAoC;QAC9C,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;YAC3B,OAAO,IAAI,UAAU,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACjC,IAAI,GAA6B,CAAC;gBAClC,IAAI,UAAoC,CAAC;gBACzC,IAAI,aAAiD,CAAC;gBAEtD,IAAI,CAAC;oBACH,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;wBACjC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE;4BACf,MAAM,OAAO,GACX,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,kBAAkB,CAAC;4BACtD,MAAM,MAAM,GACV,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;gCACnC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC;gCAC/B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;4BAClB,IAAI,MAAM,EAAE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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACpB,CAAC;gBAED,OAAO,GAAG,EAAE;oBACV,IAAI,GAAG;wBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;oBAC3B,IAAI,UAAU;wBAAE,UAAU,CAAC,WAAW,EAAE,CAAC;gBAC3C,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { Subscription } from \"rxjs\";\nimport { Observable } from \"rxjs\";\n\nimport type { ErrorLike } from \"@apollo/client\";\nimport {\n CombinedGraphQLErrors,\n graphQLResultHasProtocolErrors,\n PROTOCOL_ERRORS_SYMBOL,\n toErrorLike,\n} from \"@apollo/client/errors\";\nimport { ApolloLink } from \"@apollo/client/link\";\n\nexport declare namespace ErrorLink {\n // Using a different namespace name to avoid clash with\n // `ApolloLink.DocumentationTypes`\n export namespace ErrorLinkDocumentationTypes {\n /**\n * Callback that is called by `ErrorLink` when an error occurs from a\n * downstream link in link chain.\n *\n * @param options - The options object provided by `ErrorLink` to the error\n * handler when an error occurs.\n */\n export function ErrorHandler(\n options: ErrorHandlerOptions\n ): Observable<ApolloLink.Result> | void;\n }\n\n /** {@inheritDoc @apollo/client/link/error!ErrorLink.ErrorLinkDocumentationTypes.ErrorHandler:function(1)} */\n export interface ErrorHandler {\n (options: ErrorHandlerOptions): Observable<ApolloLink.Result> | void;\n }\n\n /**\n * The object provided to the `ErrorHandler` callback function.\n */\n export interface ErrorHandlerOptions {\n /**\n * The error that occurred during the operation execution. This can be a\n * `CombinedGraphQLErrors` instance (for GraphQL errors) or another error\n * type (for network errors).\n *\n * Use `CombinedGraphQLErrors.is(error)` to check if it's a GraphQL error with an `errors` array.\n */\n error: ErrorLike;\n /**\n * The raw GraphQL result from the server (if available), which may include\n * partial data alongside errors.\n */\n result?: ApolloLink.Result;\n\n /** The details of the GraphQL operation that produced an error. */\n operation: ApolloLink.Operation;\n\n /**\n * A function that calls the next link in the link chain. Calling\n * `return forward(operation)` in your `ErrorLink` callback\n * [retries the operation](../../data/error-handling#retrying-operations), returning a new observable for the\n * upstream link to subscribe to.\n */\n forward: ApolloLink.ForwardFunction;\n }\n}\n\n/**\n * @deprecated\n * Use `ErrorLink` from `@apollo/client/link/error` instead.\n */\nexport function onError(errorHandler: ErrorLink.ErrorHandler) {\n return new ErrorLink(errorHandler);\n}\n\n/**\n * Use the `ErrorLink` to perform custom logic when a [GraphQL or network error](https://apollographql.com/docs/react/data/error-handling)\n * occurs.\n *\n * @remarks\n *\n * This link is used after the GraphQL operation completes and execution is\n * moving back up your [link chain](https://apollographql.com/docs/react/introduction#handling-a-response). The `errorHandler` function should\n * not return a value unless you want to [retry the operation](https://apollographql.com/docs/react/data/error-handling#retrying-operations).\n *\n * For more information on the types of errors that might be encountered, see\n * the guide on [error handling](https://apollographql.com/docs/react/data/error-handling).\n *\n * @example\n *\n * ```ts\n * import { ErrorLink } from \"@apollo/client/link/error\";\n * import {\n * CombinedGraphQLErrors,\n * CombinedProtocolErrors,\n * } from \"@apollo/client/errors\";\n *\n * // Log any GraphQL errors, protocol errors, or network error that occurred\n * const errorLink = new ErrorLink(({ error, operation }) => {\n * if (CombinedGraphQLErrors.is(error)) {\n * error.errors.forEach(({ message, locations, path }) =>\n * console.log(\n * `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`\n * )\n * );\n * } else if (CombinedProtocolErrors.is(error)) {\n * error.errors.forEach(({ message, extensions }) =>\n * console.log(\n * `[Protocol error]: Message: ${message}, Extensions: ${JSON.stringify(\n * extensions\n * )}`\n * )\n * );\n * } else {\n * console.error(`[Network error]: ${error}`);\n * }\n * });\n * ```\n */\nexport class ErrorLink extends ApolloLink {\n constructor(errorHandler: ErrorLink.ErrorHandler) {\n super((operation, forward) => {\n return new Observable((observer) => {\n let sub: Subscription | undefined;\n let retriedSub: Subscription | undefined;\n let retriedResult: ReturnType<ErrorLink.ErrorHandler>;\n\n try {\n sub = forward(operation).subscribe({\n next: (result) => {\n const handler =\n operation.client[\"queryManager\"].incrementalHandler;\n const errors =\n handler.isIncrementalResult(result) ?\n handler.extractErrors(result)\n : result.errors;\n if (errors) {\n retriedResult = errorHandler({\n error: new CombinedGraphQLErrors(result, errors),\n result,\n operation,\n forward,\n });\n } else if (graphQLResultHasProtocolErrors(result)) {\n retriedResult = errorHandler({\n error: result.extensions[PROTOCOL_ERRORS_SYMBOL],\n result,\n operation,\n forward,\n });\n }\n\n retriedSub = retriedResult?.subscribe(observer);\n\n if (!retriedSub) {\n observer.next(result);\n }\n },\n error: (error) => {\n retriedResult = errorHandler({\n operation,\n error: toErrorLike(error),\n forward,\n });\n retriedSub = retriedResult?.subscribe(observer);\n\n if (!retriedSub) {\n observer.error(error);\n }\n },\n complete: () => {\n // disable the previous sub from calling complete on observable\n // if retry is in flight.\n if (!retriedResult) {\n observer.complete();\n }\n },\n });\n } catch (e) {\n errorHandler({ error: toErrorLike(e), operation, forward });\n observer.error(e);\n }\n\n return () => {\n if (sub) sub.unsubscribe();\n if (retriedSub) retriedSub.unsubscribe();\n };\n });\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/error/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,sBAAsB,EACtB,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAsDjD;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,YAAoC;IAC1D,OAAO,IAAI,SAAS,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,SAAU,SAAQ,UAAU;IACvC,YAAY,YAAoC;QAC9C,KAAK,CAAC,CAAC,SAAS,EAAE,OA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OAAO;6BACR,CAAC,CAAC;4BACH,UAAU,GAAG,aAAa,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;4BAEhD,IAAI,CAAC,UAAU,EAAE,CAAC;gCAChB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;4BACxB,CAAC;wBACH,CAAC;wBACD,QAAQ,EAAE,GAAG,EAAE;4BACb,+DAA+D;4BAC/D,yBAAyB;4BACzB,IAAI,CAAC,aAAa,EAAE,CAAC;gCACnB,QAAQ,CAAC,QAAQ,EAAE,CAAC;4BACtB,CAAC;wBACH,CAAC;qBACF,CAAC,CAAC;gBACL,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,YAAY,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;oBAC5D,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACpB,CAAC;gBAED,OAAO,GAAG,EAAE;oBACV,IAAI,GAAG;wBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;oBAC3B,IAAI,UAAU;wBAAE,UAAU,CAAC,WAAW,EAAE,CAAC;gBAC3C,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { Subscription } from \"rxjs\";\nimport { Observable } from \"rxjs\";\n\nimport type { ErrorLike } from \"@apollo/client\";\nimport {\n CombinedGraphQLErrors,\n graphQLResultHasProtocolErrors,\n PROTOCOL_ERRORS_SYMBOL,\n toErrorLike,\n} from \"@apollo/client/errors\";\nimport { ApolloLink } from \"@apollo/client/link\";\n\nexport declare namespace ErrorLink {\n // Using a different namespace name to avoid clash with\n // `ApolloLink.DocumentationTypes`\n export namespace ErrorLinkDocumentationTypes {\n /**\n * Callback that is called by `ErrorLink` when an error occurs from a\n * downstream link in link chain.\n *\n * @param options - The options object provided by `ErrorLink` to the error\n * handler when an error occurs.\n */\n export function ErrorHandler(\n options: ErrorHandlerOptions\n ): Observable<ApolloLink.Result> | void;\n }\n\n /** {@inheritDoc @apollo/client/link/error!ErrorLink.ErrorLinkDocumentationTypes.ErrorHandler:function(1)} */\n export interface ErrorHandler {\n (options: ErrorHandlerOptions): Observable<ApolloLink.Result> | void;\n }\n\n /**\n * The object provided to the `ErrorHandler` callback function.\n */\n export interface ErrorHandlerOptions {\n /**\n * The error that occurred during the operation execution. This can be a\n * `CombinedGraphQLErrors` instance (for GraphQL errors) or another error\n * type (for network errors).\n *\n * Use `CombinedGraphQLErrors.is(error)` to check if it's a GraphQL error with an `errors` array.\n */\n error: ErrorLike;\n /**\n * The raw GraphQL result from the server (if available), which may include\n * partial data alongside errors.\n */\n result?: ApolloLink.Result;\n\n /** The details of the GraphQL operation that produced an error. */\n operation: ApolloLink.Operation;\n\n /**\n * A function that calls the next link in the link chain. Calling\n * `return forward(operation)` in your `ErrorLink` callback\n * [retries the operation](../../data/error-handling#retrying-operations), returning a new observable for the\n * upstream link to subscribe to.\n */\n forward: ApolloLink.ForwardFunction;\n }\n}\n\n/**\n * @deprecated\n * Use `ErrorLink` from `@apollo/client/link/error` instead.\n */\nexport function onError(errorHandler: ErrorLink.ErrorHandler) {\n return new ErrorLink(errorHandler);\n}\n\n/**\n * Use the `ErrorLink` to perform custom logic when a [GraphQL or network error](https://apollographql.com/docs/react/data/error-handling)\n * occurs.\n *\n * @remarks\n *\n * This link is used after the GraphQL operation completes and execution is\n * moving back up your [link chain](https://apollographql.com/docs/react/api/link/introduction#handling-a-response). The `errorHandler` function should\n * not return a value unless you want to [retry the operation](https://apollographql.com/docs/react/data/error-handling#retrying-operations).\n *\n * For more information on the types of errors that might be encountered, see\n * the guide on [error handling](https://apollographql.com/docs/react/data/error-handling).\n *\n * @example\n *\n * ```ts\n * import { ErrorLink } from \"@apollo/client/link/error\";\n * import {\n * CombinedGraphQLErrors,\n * CombinedProtocolErrors,\n * } from \"@apollo/client/errors\";\n *\n * // Log any GraphQL errors, protocol errors, or network error that occurred\n * const errorLink = new ErrorLink(({ error, operation }) => {\n * if (CombinedGraphQLErrors.is(error)) {\n * error.errors.forEach(({ message, locations, path }) =>\n * console.log(\n * `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`\n * )\n * );\n * } else if (CombinedProtocolErrors.is(error)) {\n * error.errors.forEach(({ message, extensions }) =>\n * console.log(\n * `[Protocol error]: Message: ${message}, Extensions: ${JSON.stringify(\n * extensions\n * )}`\n * )\n * );\n * } else {\n * console.error(`[Network error]: ${error}`);\n * }\n * });\n * ```\n */\nexport class ErrorLink extends ApolloLink {\n constructor(errorHandler: ErrorLink.ErrorHandler) {\n super((operation, forward) => {\n return new Observable((observer) => {\n let sub: Subscription | undefined;\n let retriedSub: Subscription | undefined;\n let retriedResult: ReturnType<ErrorLink.ErrorHandler>;\n\n try {\n sub = forward(operation).subscribe({\n next: (result) => {\n const handler =\n operation.client[\"queryManager\"].incrementalHandler;\n const errors =\n handler.isIncrementalResult(result) ?\n handler.extractErrors(result)\n : result.errors;\n if (errors) {\n retriedResult = errorHandler({\n error: new CombinedGraphQLErrors(result, errors),\n result,\n operation,\n forward,\n });\n } else if (graphQLResultHasProtocolErrors(result)) {\n retriedResult = errorHandler({\n error: result.extensions[PROTOCOL_ERRORS_SYMBOL],\n result,\n operation,\n forward,\n });\n }\n\n retriedSub = retriedResult?.subscribe(observer);\n\n if (!retriedSub) {\n observer.next(result);\n }\n },\n error: (error) => {\n retriedResult = errorHandler({\n operation,\n error: toErrorLike(error),\n forward,\n });\n retriedSub = retriedResult?.subscribe(observer);\n\n if (!retriedSub) {\n observer.error(error);\n }\n },\n complete: () => {\n // disable the previous sub from calling complete on observable\n // if retry is in flight.\n if (!retriedResult) {\n observer.complete();\n }\n },\n });\n } catch (e) {\n errorHandler({ error: toErrorLike(e), operation, forward });\n observer.error(e);\n }\n\n return () => {\n if (sub) sub.unsubscribe();\n if (retriedSub) retriedSub.unsubscribe();\n };\n });\n });\n }\n}\n"]}
|
|
@@ -31,7 +31,7 @@ async function* consumeMultipartBody(response) {
|
|
|
31
31
|
(?:;|$) # match a semicolon or end of string
|
|
32
32
|
*/
|
|
33
33
|
/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i);
|
|
34
|
-
const boundary = "\r\n--" + (match
|
|
34
|
+
const boundary = "\r\n--" + (match ? match[1] ?? match[2] ?? match[3] ?? "-" : "-");
|
|
35
35
|
let buffer = "";
|
|
36
36
|
invariant(response.body && typeof response.body.getReader === "function", 60);
|
|
37
37
|
const stream = response.body;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseAndCheckHttpResponse.js","sources":["../../../src/link/http/parseAndCheckHttpResponse.ts"],"sourcesContent":["import {\n CombinedProtocolErrors,\n PROTOCOL_ERRORS_SYMBOL,\n ServerError,\n ServerParseError,\n} from \"@apollo/client/errors\";\nimport type { ApolloLink, ApolloPayloadResult } from \"@apollo/client/link\";\nimport { isNonNullObject } from \"@apollo/client/utilities/internal\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * This function detects an Apollo payload result before it is transformed\n * into a FetchResult via HttpLink; it cannot detect an ApolloPayloadResult\n * once it leaves the link chain.\n */\nfunction isApolloPayloadResult(value: unknown): value is ApolloPayloadResult {\n return isNonNullObject(value) && \"payload\" in value;\n}\n\nasync function* consumeMultipartBody(\n response: Response\n): AsyncGenerator<string, void, void> {\n const decoder = new TextDecoder(\"utf-8\");\n const contentType = response.headers?.get(\"content-type\");\n\n // parse boundary value and ignore any subsequent name/value pairs after ;\n // https://www.rfc-editor.org/rfc/rfc9110.html#name-parameters\n // e.g. multipart/mixed;boundary=\"graphql\";deferSpec=20220824\n // if no boundary is specified, default to -\n const match = contentType?.match(\n /*\n ;\\s*boundary= # Match the boundary parameter\n (?: # either\n '([^']*)' # a string starting with ' doesn't contain ', ends with '\n | # or\n \"([^\"]*)\" # a string starting with \" doesn't contain \", ends with \"\n | # or\n ([^\"'].*?) # a string that doesn't start with ' or \", parsed non-greedily\n ) # end of the group\n \\s* # optional whitespace\n (?:;|$) # match a semicolon or end of string\n */\n /;\\s*boundary=(?:'([^']+)'|\"([^\"]+)\"|([^\"'].+?))\\s*(?:;|$)/i\n );\n const boundary = \"\\r\\n--\" + (match?.findLast((val) => !!val) || \"-\");\n let buffer = \"\";\n invariant(\n response.body && typeof response.body.getReader === \"function\",\n \"Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`.\"\n );\n\n const stream = response.body;\n const reader = stream.getReader();\n let done = false;\n let encounteredBoundary = false;\n let value: Uint8Array<ArrayBufferLike> | string | undefined;\n\n // check to see if we received the final boundary, which is a normal boundary followed by \"--\"\n // as described in https://www.rfc-editor.org/rfc/rfc2046#section-5.1.1\n const passedFinalBoundary = () =>\n encounteredBoundary && buffer[0] == \"-\" && buffer[1] == \"-\";\n\n try {\n while (!done) {\n ({ value, done } = await reader.read());\n const chunk = typeof value === \"string\" ? value : decoder.decode(value);\n const searchFrom = buffer.length - boundary.length + 1;\n buffer += chunk;\n let bi = buffer.indexOf(boundary, searchFrom);\n while (bi > -1 && !passedFinalBoundary()) {\n encounteredBoundary = true;\n let message: string;\n [message, buffer] = [\n buffer.slice(0, bi),\n buffer.slice(bi + boundary.length),\n ];\n const i = message.indexOf(\"\\r\\n\\r\\n\");\n const headers = parseHeaders(message.slice(0, i));\n const contentType = headers[\"content-type\"];\n if (\n contentType &&\n contentType.toLowerCase().indexOf(\"application/json\") === -1\n ) {\n throw new Error(\n \"Unsupported patch content type: application/json is required.\"\n );\n }\n // nb: Technically you'd want to slice off the beginning \"\\r\\n\" but since\n // this is going to be `JSON.parse`d there is no need.\n const body = message.slice(i);\n\n if (body) {\n yield body;\n }\n bi = buffer.indexOf(boundary);\n }\n if (passedFinalBoundary()) {\n return;\n }\n }\n throw new Error(\"premature end of multipart body\");\n } finally {\n reader.cancel();\n }\n}\n\nexport async function readMultipartBody<\n T extends object = Record<string, unknown>,\n>(response: Response, nextValue: (value: T) => void) {\n for await (const body of consumeMultipartBody(response)) {\n const result = parseJsonEncoding(response, body);\n if (Object.keys(result).length == 0) continue;\n if (isApolloPayloadResult(result)) {\n if (Object.keys(result).length === 1 && result.payload === null) {\n return;\n }\n let next = { ...result.payload };\n if (\"errors\" in result) {\n next.extensions = {\n ...next.extensions,\n [PROTOCOL_ERRORS_SYMBOL]: new CombinedProtocolErrors(\n result.errors ?? []\n ),\n };\n }\n nextValue(next as T);\n } else {\n nextValue(result);\n }\n }\n}\n\nfunction parseHeaders(headerText: string): Record<string, string> {\n const headersInit: Record<string, string> = {};\n headerText.split(\"\\n\").forEach((line) => {\n const i = line.indexOf(\":\");\n if (i > -1) {\n // normalize headers to lowercase\n const name = line.slice(0, i).trim().toLowerCase();\n const value = line.slice(i + 1).trim();\n headersInit[name] = value;\n }\n });\n return headersInit;\n}\n\nfunction parseJsonEncoding(response: Response, bodyText: string) {\n if (response.status >= 300) {\n throw new ServerError(\n `Response not successful: Received status code ${response.status}`,\n { response, bodyText }\n );\n }\n\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n throw new ServerParseError(err, { response, bodyText });\n }\n}\n\nfunction parseGraphQLResponseJsonEncoding(\n response: Response,\n bodyText: string\n) {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n throw new ServerParseError(err, { response, bodyText });\n }\n}\n\nfunction parseResponse(response: Response, bodyText: string) {\n const contentType = response.headers.get(\"content-type\");\n\n if (contentType?.includes(\"application/graphql-response+json\")) {\n return parseGraphQLResponseJsonEncoding(response, bodyText);\n }\n\n return parseJsonEncoding(response, bodyText);\n}\n\nexport function parseAndCheckHttpResponse(\n operations: ApolloLink.Operation | ApolloLink.Operation[]\n) {\n return (response: Response) =>\n response.text().then((bodyText) => {\n const result = parseResponse(response, bodyText);\n\n if (\n !Array.isArray(result) &&\n !hasOwnProperty.call(result, \"data\") &&\n !hasOwnProperty.call(result, \"errors\")\n ) {\n throw new ServerError(\n `Server response was malformed for query '${\n Array.isArray(operations) ?\n operations.map((op) => op.operationName)\n : operations.operationName\n }'.`,\n { response, bodyText }\n );\n }\n return result;\n });\n}\n"],"names":[],"mappings":"AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EACL,CADF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACwB,EACtB,CAFF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAEwB,EACtB,CAHF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAGa,EACX,CAJF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAIkB,EAJlB,EAAA,CAAA,CAAA,CAAA,EAKO,CALP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAK8B;AAE9B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAgC,CAAhC,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,CAAmE;AACnE,CAAA,CAAA,CAAA,CAA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AAqC,CAArC,CAAuC,CAAC,CAAxC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqD;gBACzC,EAAE,CAAd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACU,CADV,CAAA,CAAA,CACc,EACJ,EAAE,CAFZ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAEoB,EAAE,CAFtB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAEgC,CACvB;QACH;QACA,CAAN,CAAA,CAAA,CAAA,CAAA,EAAa,CAAb,CAAA,CAAA,CAAA,CAAA,CAAmB;IACf,CAAC,CAAC;AACN;"}
|
|
1
|
+
{"version":3,"file":"parseAndCheckHttpResponse.js","sources":["../../../src/link/http/parseAndCheckHttpResponse.ts"],"sourcesContent":["import {\n CombinedProtocolErrors,\n PROTOCOL_ERRORS_SYMBOL,\n ServerError,\n ServerParseError,\n} from \"@apollo/client/errors\";\nimport type { ApolloLink, ApolloPayloadResult } from \"@apollo/client/link\";\nimport { isNonNullObject } from \"@apollo/client/utilities/internal\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * This function detects an Apollo payload result before it is transformed\n * into a FetchResult via HttpLink; it cannot detect an ApolloPayloadResult\n * once it leaves the link chain.\n */\nfunction isApolloPayloadResult(value: unknown): value is ApolloPayloadResult {\n return isNonNullObject(value) && \"payload\" in value;\n}\n\nasync function* consumeMultipartBody(\n response: Response\n): AsyncGenerator<string, void, void> {\n const decoder = new TextDecoder(\"utf-8\");\n const contentType = response.headers?.get(\"content-type\");\n\n // parse boundary value and ignore any subsequent name/value pairs after ;\n // https://www.rfc-editor.org/rfc/rfc9110.html#name-parameters\n // e.g. multipart/mixed;boundary=\"graphql\";deferSpec=20220824\n // if no boundary is specified, default to -\n const match = contentType?.match(\n /*\n ;\\s*boundary= # Match the boundary parameter\n (?: # either\n '([^']*)' # a string starting with ' doesn't contain ', ends with '\n | # or\n \"([^\"]*)\" # a string starting with \" doesn't contain \", ends with \"\n | # or\n ([^\"'].*?) # a string that doesn't start with ' or \", parsed non-greedily\n ) # end of the group\n \\s* # optional whitespace\n (?:;|$) # match a semicolon or end of string\n */\n /;\\s*boundary=(?:'([^']+)'|\"([^\"]+)\"|([^\"'].+?))\\s*(?:;|$)/i\n );\n const boundary =\n \"\\r\\n--\" + (match ? match[1] ?? match[2] ?? match[3] ?? \"-\" : \"-\");\n let buffer = \"\";\n invariant(\n response.body && typeof response.body.getReader === \"function\",\n \"Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`.\"\n );\n\n const stream = response.body;\n const reader = stream.getReader();\n let done = false;\n let encounteredBoundary = false;\n let value: Uint8Array<ArrayBufferLike> | string | undefined;\n\n // check to see if we received the final boundary, which is a normal boundary followed by \"--\"\n // as described in https://www.rfc-editor.org/rfc/rfc2046#section-5.1.1\n const passedFinalBoundary = () =>\n encounteredBoundary && buffer[0] == \"-\" && buffer[1] == \"-\";\n\n try {\n while (!done) {\n ({ value, done } = await reader.read());\n const chunk = typeof value === \"string\" ? value : decoder.decode(value);\n const searchFrom = buffer.length - boundary.length + 1;\n buffer += chunk;\n let bi = buffer.indexOf(boundary, searchFrom);\n while (bi > -1 && !passedFinalBoundary()) {\n encounteredBoundary = true;\n let message: string;\n [message, buffer] = [\n buffer.slice(0, bi),\n buffer.slice(bi + boundary.length),\n ];\n const i = message.indexOf(\"\\r\\n\\r\\n\");\n const headers = parseHeaders(message.slice(0, i));\n const contentType = headers[\"content-type\"];\n if (\n contentType &&\n contentType.toLowerCase().indexOf(\"application/json\") === -1\n ) {\n throw new Error(\n \"Unsupported patch content type: application/json is required.\"\n );\n }\n // nb: Technically you'd want to slice off the beginning \"\\r\\n\" but since\n // this is going to be `JSON.parse`d there is no need.\n const body = message.slice(i);\n\n if (body) {\n yield body;\n }\n bi = buffer.indexOf(boundary);\n }\n if (passedFinalBoundary()) {\n return;\n }\n }\n throw new Error(\"premature end of multipart body\");\n } finally {\n reader.cancel();\n }\n}\n\nexport async function readMultipartBody<\n T extends object = Record<string, unknown>,\n>(response: Response, nextValue: (value: T) => void) {\n for await (const body of consumeMultipartBody(response)) {\n const result = parseJsonEncoding(response, body);\n if (Object.keys(result).length == 0) continue;\n if (isApolloPayloadResult(result)) {\n if (Object.keys(result).length === 1 && result.payload === null) {\n return;\n }\n let next = { ...result.payload };\n if (\"errors\" in result) {\n next.extensions = {\n ...next.extensions,\n [PROTOCOL_ERRORS_SYMBOL]: new CombinedProtocolErrors(\n result.errors ?? []\n ),\n };\n }\n nextValue(next as T);\n } else {\n nextValue(result);\n }\n }\n}\n\nfunction parseHeaders(headerText: string): Record<string, string> {\n const headersInit: Record<string, string> = {};\n headerText.split(\"\\n\").forEach((line) => {\n const i = line.indexOf(\":\");\n if (i > -1) {\n // normalize headers to lowercase\n const name = line.slice(0, i).trim().toLowerCase();\n const value = line.slice(i + 1).trim();\n headersInit[name] = value;\n }\n });\n return headersInit;\n}\n\nfunction parseJsonEncoding(response: Response, bodyText: string) {\n if (response.status >= 300) {\n throw new ServerError(\n `Response not successful: Received status code ${response.status}`,\n { response, bodyText }\n );\n }\n\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n throw new ServerParseError(err, { response, bodyText });\n }\n}\n\nfunction parseGraphQLResponseJsonEncoding(\n response: Response,\n bodyText: string\n) {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n throw new ServerParseError(err, { response, bodyText });\n }\n}\n\nfunction parseResponse(response: Response, bodyText: string) {\n const contentType = response.headers.get(\"content-type\");\n\n if (contentType?.includes(\"application/graphql-response+json\")) {\n return parseGraphQLResponseJsonEncoding(response, bodyText);\n }\n\n return parseJsonEncoding(response, bodyText);\n}\n\nexport function parseAndCheckHttpResponse(\n operations: ApolloLink.Operation | ApolloLink.Operation[]\n) {\n return (response: Response) =>\n response.text().then((bodyText) => {\n const result = parseResponse(response, bodyText);\n\n if (\n !Array.isArray(result) &&\n !hasOwnProperty.call(result, \"data\") &&\n !hasOwnProperty.call(result, \"errors\")\n ) {\n throw new ServerError(\n `Server response was malformed for query '${\n Array.isArray(operations) ?\n operations.map((op) => op.operationName)\n : operations.operationName\n }'.`,\n { response, bodyText }\n );\n }\n return result;\n });\n}\n"],"names":[],"mappings":"AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EACL,CADF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACwB,EACtB,CAFF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAEwB,EACtB,CAHF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAGa,EACX,CAJF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAIkB,EAJlB,EAAA,CAAA,CAAA,CAAA,EAKO,CALP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAK8B;AAE9B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAgC,CAAhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAEoC,EAAE;gBACxB,CAAd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAzB,CAAA,CAA4B,CAAC,CAAC,CAA9B,CAAgC,EAAE,CAAlC,EAAqC,CAArC,CAAuC,CAAC,CAAxC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqD;gBACzC,EAAE,CAAd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACU,CADV,CAAA,CAAA,CACc,EACJ,EAAE,CAFZ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAEoB,EAAE,CAFtB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAEgC,CACvB;QACH;QACA,CAAN,CAAA,CAAA,CAAA,CAAA,EAAa,CAAb,CAAA,CAAA,CAAA,CAAA,CAAmB;IACf,CAAC,CAAC;AACN;"}
|
|
@@ -130,5 +130,8 @@ export declare function removeTypenameFromVariables(options?: RemoveTypenameFrom
|
|
|
130
130
|
*/
|
|
131
131
|
export declare class RemoveTypenameFromVariablesLink extends ApolloLink {
|
|
132
132
|
constructor(options?: RemoveTypenameFromVariablesLink.Options);
|
|
133
|
+
private maybeStripTypenameUsingConfig;
|
|
134
|
+
private maybeStripTypename;
|
|
135
|
+
private getVariableDefinitions;
|
|
133
136
|
}
|
|
134
137
|
//# sourceMappingURL=removeTypenameFromVariables.d.ts.map
|
|
@@ -4,7 +4,7 @@ import { wrap } from "optimism";
|
|
|
4
4
|
import { ApolloLink } from "@apollo/client/link";
|
|
5
5
|
import { cacheSizes, stripTypename } from "@apollo/client/utilities";
|
|
6
6
|
import { __DEV__ } from "@apollo/client/utilities/environment";
|
|
7
|
-
import { isPlainObject } from "@apollo/client/utilities/internal";
|
|
7
|
+
import { bindCacheKey, isPlainObject } from "@apollo/client/utilities/internal";
|
|
8
8
|
/**
|
|
9
9
|
* Sentinel value used to indicate that `__typename` fields should be kept
|
|
10
10
|
* for a specific field or input type.
|
|
@@ -69,7 +69,7 @@ export class RemoveTypenameFromVariablesLink extends ApolloLink {
|
|
|
69
69
|
if (variables) {
|
|
70
70
|
operation.variables =
|
|
71
71
|
except ?
|
|
72
|
-
maybeStripTypenameUsingConfig(query, variables, except)
|
|
72
|
+
this.maybeStripTypenameUsingConfig(query, variables, except)
|
|
73
73
|
: stripTypename(variables);
|
|
74
74
|
}
|
|
75
75
|
return forward(operation);
|
|
@@ -79,64 +79,65 @@ export class RemoveTypenameFromVariablesLink extends ApolloLink {
|
|
|
79
79
|
getMemoryInternals() {
|
|
80
80
|
return {
|
|
81
81
|
removeTypenameFromVariables: {
|
|
82
|
-
getVariableDefinitions: getVariableDefinitions?.size ?? 0,
|
|
82
|
+
getVariableDefinitions: this.getVariableDefinitions?.size ?? 0,
|
|
83
83
|
},
|
|
84
84
|
};
|
|
85
85
|
},
|
|
86
86
|
}
|
|
87
87
|
: {});
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
function maybeStripTypename(value, config) {
|
|
104
|
-
if (config === KEEP) {
|
|
105
|
-
return value;
|
|
89
|
+
maybeStripTypenameUsingConfig(query, variables, config) {
|
|
90
|
+
const variableDefinitions = this.getVariableDefinitions(query);
|
|
91
|
+
return Object.fromEntries(Object.entries(variables).map((keyVal) => {
|
|
92
|
+
const [key, value] = keyVal;
|
|
93
|
+
const typename = variableDefinitions[key];
|
|
94
|
+
const typenameConfig = config[typename];
|
|
95
|
+
keyVal[1] =
|
|
96
|
+
typenameConfig ?
|
|
97
|
+
this.maybeStripTypename(value, typenameConfig)
|
|
98
|
+
: stripTypename(value);
|
|
99
|
+
return keyVal;
|
|
100
|
+
}));
|
|
106
101
|
}
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
maybeStripTypename(value, config) {
|
|
103
|
+
if (config === KEEP) {
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
if (Array.isArray(value)) {
|
|
107
|
+
return value.map((item) => this.maybeStripTypename(item, config));
|
|
108
|
+
}
|
|
109
|
+
if (isPlainObject(value)) {
|
|
110
|
+
const modified = {};
|
|
111
|
+
Object.keys(value).forEach((key) => {
|
|
112
|
+
const child = value[key];
|
|
113
|
+
if (key === "__typename") {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const fieldConfig = config[key];
|
|
117
|
+
modified[key] =
|
|
118
|
+
fieldConfig ?
|
|
119
|
+
this.maybeStripTypename(child, fieldConfig)
|
|
120
|
+
: stripTypename(child);
|
|
121
|
+
});
|
|
122
|
+
return modified;
|
|
123
|
+
}
|
|
124
|
+
return value;
|
|
109
125
|
}
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
const fieldConfig = config[key];
|
|
118
|
-
modified[key] =
|
|
119
|
-
fieldConfig ?
|
|
120
|
-
maybeStripTypename(child, fieldConfig)
|
|
121
|
-
: stripTypename(child);
|
|
126
|
+
getVariableDefinitions = wrap((document) => {
|
|
127
|
+
const definitions = {};
|
|
128
|
+
visit(document, {
|
|
129
|
+
VariableDefinition(node) {
|
|
130
|
+
definitions[node.variable.name.value] = unwrapType(node.type);
|
|
131
|
+
},
|
|
122
132
|
});
|
|
123
|
-
return
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
visit(document, {
|
|
130
|
-
VariableDefinition(node) {
|
|
131
|
-
definitions[node.variable.name.value] = unwrapType(node.type);
|
|
132
|
-
},
|
|
133
|
+
return definitions;
|
|
134
|
+
}, {
|
|
135
|
+
max: cacheSizes["removeTypenameFromVariables.getVariableDefinitions"] ||
|
|
136
|
+
2000 /* defaultCacheSizes["removeTypenameFromVariables.getVariableDefinitions"] */,
|
|
137
|
+
cache: WeakCache,
|
|
138
|
+
makeCacheKey: bindCacheKey(this),
|
|
133
139
|
});
|
|
134
|
-
|
|
135
|
-
}, {
|
|
136
|
-
max: cacheSizes["removeTypenameFromVariables.getVariableDefinitions"] ||
|
|
137
|
-
2000 /* defaultCacheSizes["removeTypenameFromVariables.getVariableDefinitions"] */,
|
|
138
|
-
cache: WeakCache,
|
|
139
|
-
});
|
|
140
|
+
}
|
|
140
141
|
function unwrapType(node) {
|
|
141
142
|
switch (node.kind) {
|
|
142
143
|
case Kind.NON_NULL_TYPE:
|