@apollo/client 4.0.9 → 4.0.11
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 +19 -0
- package/__cjs/cache/core/cache.cjs +1 -1
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- 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/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- 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/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/checkDocument.cjs +2 -4
- package/__cjs/utilities/internal/checkDocument.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 +4 -2
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +1 -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.js +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- 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/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/parseAndCheckHttpResponse.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/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/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/checkDocument.js +2 -4
- package/utilities/internal/checkDocument.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 +1 -0
- package/utilities/internal/index.js +1 -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
|
}
|
|
@@ -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,CA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BACxB,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;"}
|
|
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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AAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAEY,CAFZ,CAAA,CAAA,CAAA,CAEiB,CAAC,CAFlB,CAAA,CAAA,CAAA,CAAA,CAAA,CAEyB,CAAC,CAF1B,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;"}
|
package/link/schema/index.d.ts
CHANGED
|
@@ -129,7 +129,7 @@ export declare namespace SchemaLink {
|
|
|
129
129
|
/**
|
|
130
130
|
* `SchemaLink` is a terminating link that executes GraphQL operations against
|
|
131
131
|
* a local GraphQL schema instead of making network requests. This is commonly
|
|
132
|
-
* used for server-side rendering (SSR) and mocking
|
|
132
|
+
* used for server-side rendering (SSR) and mocking data.
|
|
133
133
|
*
|
|
134
134
|
* > [!NOTE]
|
|
135
135
|
* > While `SchemaLink` can provide GraphQL results on the client, the GraphQL
|
package/link/schema/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ApolloLink } from "@apollo/client/link";
|
|
|
4
4
|
/**
|
|
5
5
|
* `SchemaLink` is a terminating link that executes GraphQL operations against
|
|
6
6
|
* a local GraphQL schema instead of making network requests. This is commonly
|
|
7
|
-
* used for server-side rendering (SSR) and mocking
|
|
7
|
+
* used for server-side rendering (SSR) and mocking data.
|
|
8
8
|
*
|
|
9
9
|
* > [!NOTE]
|
|
10
10
|
* > While `SchemaLink` can provide GraphQL results on the client, the GraphQL
|
package/link/schema/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA+GjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IACjC,MAAM,CAA+B;IACrC,SAAS,CAAkC;IAC3C,OAAO,CAAgC;IACvC,QAAQ,CAAU;IAEzB,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACrC,CAAC;IAEM,OAAO,CACZ,SAA+B;QAE/B,OAAO,IAAI,UAAU,CAAoB,CAAC,QAAQ,EAAE,EAAE;YACpD,IAAI,OAAO,CAA6B,CAAC,OAAO,EAAE,EAAE,CAClD,OAAO,CACL,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC;gBAClC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;gBACzB,CAAC,CAAC,IAAI,CAAC,OAAO,CACf,CACF;iBACE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;gBAChB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAClB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;oBAChE,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBAChC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;oBACtC,CAAC;gBACH,CAAC;gBAED,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,QAAQ,EAAE,SAAS,CAAC,KAAK;oBACzB,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,YAAY,EAAE,OAAO;oBACrB,cAAc,EAAE,SAAS,CAAC,SAAS;oBACnC,aAAa,EAAE,SAAS,CAAC,aAAa;iBACvC,CAAC,CAAC;YACL,CAAC,CAAC;iBACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBACb,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;oBACrB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACpB,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACtB,CAAC;YACH,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBACf,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;oBACrB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { GraphQLSchema } from \"graphql\";\nimport { execute, validate } from \"graphql\";\nimport { Observable } from \"rxjs\";\n\nimport { ApolloLink } from \"@apollo/client/link\";\n\nexport declare namespace SchemaLink {\n export namespace SchemaLinkDocumentationTypes {\n /**\n * A function that returns the resolver context for a given operation.\n *\n * This function is called for each operation and allows you to create\n * operation-specific context. This is useful when you need to include\n * information from the operation (like headers, variables, etc.) in the\n * resolver context.\n *\n * @param operation - The Apollo Link operation\n * @returns The resolver context object or a promise that resolves to the context\n *\n * @example\n *\n * ```ts\n * const link = new SchemaLink({\n * schema,\n * context: (operation) => {\n * return {\n * userId: operation.getContext().userId,\n * dataSources: {\n * userAPI: new UserAPI(),\n * },\n * };\n * },\n * });\n * ```\n */\n export function ResolverContextFunction(\n operation: ApolloLink.Operation\n ): SchemaLink.ResolverContext | PromiseLike<SchemaLink.ResolverContext>;\n }\n /**\n * The resolver context object passed to GraphQL resolvers.\n *\n * This context object is passed as the third parameter to GraphQL resolvers\n * and typically contains data-fetching connectors, authentication information,\n * and other request-specific data.\n */\n export type ResolverContext = Record<string, any>;\n\n /** {@inheritDoc @apollo/client/link/schema!SchemaLink.SchemaLinkDocumentationTypes.ResolverContextFunction:function(1)} */\n export type ResolverContextFunction = (\n operation: ApolloLink.Operation\n ) => SchemaLink.ResolverContext | PromiseLike<SchemaLink.ResolverContext>;\n\n /**\n * Options for configuring the `SchemaLink`.\n */\n export interface Options {\n /**\n * An executable GraphQL schema to use for operation execution.\n *\n * @remarks\n *\n * This should be a complete, executable GraphQL schema created using\n * tools like `makeExecutableSchema` from `@graphql-tools/schema` or\n * `buildSchema` from `graphql`.\n *\n * @example\n *\n * ```ts\n * import { makeExecutableSchema } from \"@graphql-tools/schema\";\n *\n * const schema = makeExecutableSchema({\n * typeDefs,\n * resolvers,\n * });\n *\n * const link = new SchemaLink({ schema });\n * ```\n */\n schema: GraphQLSchema;\n\n /**\n * The root value passed to root-level resolvers. It's typically not used in\n * most schemas but can be useful for certain advanced patterns.\n */\n rootValue?: any;\n\n /**\n * Context object or function that returns the context object to provide to\n * resolvers. The context is passed as the third parameter to all GraphQL\n * resolvers.\n *\n * - If a static object is provided, the same context will be used for all\n * operations\n * - If a function is provided, the function is called for each operation to\n * generate operation-specific context\n */\n context?: SchemaLink.ResolverContext | SchemaLink.ResolverContextFunction;\n\n /**\n * Whether to validate incoming queries against the schema before execution.\n *\n * When enabled, queries will be validated against the schema before execution,\n * and validation errors will be returned in the result's `errors` array,\n * just like a remote GraphQL server would.\n *\n * This is useful for testing and development to catch query errors early,\n * but may add overhead in production environments.\n *\n * @defaultValue false\n */\n validate?: boolean;\n }\n}\n\n/**\n * `SchemaLink` is a terminating link that executes GraphQL operations against\n * a local GraphQL schema instead of making network requests. This is commonly\n * used for server-side rendering (SSR) and mocking
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA+GjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IACjC,MAAM,CAA+B;IACrC,SAAS,CAAkC;IAC3C,OAAO,CAAgC;IACvC,QAAQ,CAAU;IAEzB,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACrC,CAAC;IAEM,OAAO,CACZ,SAA+B;QAE/B,OAAO,IAAI,UAAU,CAAoB,CAAC,QAAQ,EAAE,EAAE;YACpD,IAAI,OAAO,CAA6B,CAAC,OAAO,EAAE,EAAE,CAClD,OAAO,CACL,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC;gBAClC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;gBACzB,CAAC,CAAC,IAAI,CAAC,OAAO,CACf,CACF;iBACE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;gBAChB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAClB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;oBAChE,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBAChC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;oBACtC,CAAC;gBACH,CAAC;gBAED,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,QAAQ,EAAE,SAAS,CAAC,KAAK;oBACzB,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,YAAY,EAAE,OAAO;oBACrB,cAAc,EAAE,SAAS,CAAC,SAAS;oBACnC,aAAa,EAAE,SAAS,CAAC,aAAa;iBACvC,CAAC,CAAC;YACL,CAAC,CAAC;iBACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBACb,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;oBACrB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACpB,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACtB,CAAC;YACH,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBACf,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;oBACrB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { GraphQLSchema } from \"graphql\";\nimport { execute, validate } from \"graphql\";\nimport { Observable } from \"rxjs\";\n\nimport { ApolloLink } from \"@apollo/client/link\";\n\nexport declare namespace SchemaLink {\n export namespace SchemaLinkDocumentationTypes {\n /**\n * A function that returns the resolver context for a given operation.\n *\n * This function is called for each operation and allows you to create\n * operation-specific context. This is useful when you need to include\n * information from the operation (like headers, variables, etc.) in the\n * resolver context.\n *\n * @param operation - The Apollo Link operation\n * @returns The resolver context object or a promise that resolves to the context\n *\n * @example\n *\n * ```ts\n * const link = new SchemaLink({\n * schema,\n * context: (operation) => {\n * return {\n * userId: operation.getContext().userId,\n * dataSources: {\n * userAPI: new UserAPI(),\n * },\n * };\n * },\n * });\n * ```\n */\n export function ResolverContextFunction(\n operation: ApolloLink.Operation\n ): SchemaLink.ResolverContext | PromiseLike<SchemaLink.ResolverContext>;\n }\n /**\n * The resolver context object passed to GraphQL resolvers.\n *\n * This context object is passed as the third parameter to GraphQL resolvers\n * and typically contains data-fetching connectors, authentication information,\n * and other request-specific data.\n */\n export type ResolverContext = Record<string, any>;\n\n /** {@inheritDoc @apollo/client/link/schema!SchemaLink.SchemaLinkDocumentationTypes.ResolverContextFunction:function(1)} */\n export type ResolverContextFunction = (\n operation: ApolloLink.Operation\n ) => SchemaLink.ResolverContext | PromiseLike<SchemaLink.ResolverContext>;\n\n /**\n * Options for configuring the `SchemaLink`.\n */\n export interface Options {\n /**\n * An executable GraphQL schema to use for operation execution.\n *\n * @remarks\n *\n * This should be a complete, executable GraphQL schema created using\n * tools like `makeExecutableSchema` from `@graphql-tools/schema` or\n * `buildSchema` from `graphql`.\n *\n * @example\n *\n * ```ts\n * import { makeExecutableSchema } from \"@graphql-tools/schema\";\n *\n * const schema = makeExecutableSchema({\n * typeDefs,\n * resolvers,\n * });\n *\n * const link = new SchemaLink({ schema });\n * ```\n */\n schema: GraphQLSchema;\n\n /**\n * The root value passed to root-level resolvers. It's typically not used in\n * most schemas but can be useful for certain advanced patterns.\n */\n rootValue?: any;\n\n /**\n * Context object or function that returns the context object to provide to\n * resolvers. The context is passed as the third parameter to all GraphQL\n * resolvers.\n *\n * - If a static object is provided, the same context will be used for all\n * operations\n * - If a function is provided, the function is called for each operation to\n * generate operation-specific context\n */\n context?: SchemaLink.ResolverContext | SchemaLink.ResolverContextFunction;\n\n /**\n * Whether to validate incoming queries against the schema before execution.\n *\n * When enabled, queries will be validated against the schema before execution,\n * and validation errors will be returned in the result's `errors` array,\n * just like a remote GraphQL server would.\n *\n * This is useful for testing and development to catch query errors early,\n * but may add overhead in production environments.\n *\n * @defaultValue false\n */\n validate?: boolean;\n }\n}\n\n/**\n * `SchemaLink` is a terminating link that executes GraphQL operations against\n * a local GraphQL schema instead of making network requests. This is commonly\n * used for server-side rendering (SSR) and mocking data.\n *\n * > [!NOTE]\n * > While `SchemaLink` can provide GraphQL results on the client, the GraphQL\n * > execution layer is [quite large](https://bundlephobia.com/result?p=graphql) for practical client-side use.\n * > For client-side state management, consider Apollo Client's [local state management](https://apollographql.com/docs/react/local-state/local-state-management/)\n * > functionality instead, which integrates with the Apollo Client cache.\n *\n * @example\n *\n * ```ts\n * import { SchemaLink } from \"@apollo/client/link/schema\";\n * import schema from \"./path/to/your/schema\";\n *\n * const link = new SchemaLink({ schema });\n * ```\n */\nexport class SchemaLink extends ApolloLink {\n public schema: SchemaLink.Options[\"schema\"];\n public rootValue: SchemaLink.Options[\"rootValue\"];\n public context: SchemaLink.Options[\"context\"];\n public validate: boolean;\n\n constructor(options: SchemaLink.Options) {\n super();\n this.schema = options.schema;\n this.rootValue = options.rootValue;\n this.context = options.context;\n this.validate = !!options.validate;\n }\n\n public request(\n operation: ApolloLink.Operation\n ): Observable<ApolloLink.Result> {\n return new Observable<ApolloLink.Result>((observer) => {\n new Promise<SchemaLink.ResolverContext>((resolve) =>\n resolve(\n typeof this.context === \"function\" ?\n this.context(operation)\n : this.context\n )\n )\n .then((context) => {\n if (this.validate) {\n const validationErrors = validate(this.schema, operation.query);\n if (validationErrors.length > 0) {\n return { errors: validationErrors };\n }\n }\n\n return execute({\n schema: this.schema,\n document: operation.query,\n rootValue: this.rootValue,\n contextValue: context,\n variableValues: operation.variables,\n operationName: operation.operationName,\n });\n })\n .then((data) => {\n if (!observer.closed) {\n observer.next(data);\n observer.complete();\n }\n })\n .catch((error) => {\n if (!observer.closed) {\n observer.error(error);\n }\n });\n });\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { equal } from "@wry/equality";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { NetworkStatus } from "@apollo/client";
|
|
4
|
-
import { maybeDeepFreeze } from "@apollo/client/utilities/internal";
|
|
4
|
+
import { maybeDeepFreeze, variablesUnknownSymbol, } from "@apollo/client/utilities/internal";
|
|
5
5
|
import { invariant } from "@apollo/client/utilities/invariant";
|
|
6
6
|
import { useRenderGuard } from "./internal/index.js";
|
|
7
7
|
import { useDeepMemo } from "./internal/useDeepMemo.js";
|
|
@@ -30,6 +30,7 @@ export function useLazyQuery(query, options) {
|
|
|
30
30
|
query,
|
|
31
31
|
initialFetchPolicy: options?.fetchPolicy,
|
|
32
32
|
fetchPolicy: "standby",
|
|
33
|
+
[variablesUnknownSymbol]: true,
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
const [currentClient, setCurrentClient] = React.useState(client);
|