@apollo/client 3.10.2 → 3.10.4
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 +42 -0
- package/apollo-client.cjs +107 -100
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +82 -9
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +82 -9
- package/cache/core/cache.js +8 -4
- package/cache/core/cache.js.map +1 -1
- package/cache/inmemory/writeToStore.js +1 -1
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.js +2 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.js +1 -1
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.js +7 -11
- package/core/QueryInfo.js.map +1 -1
- package/core/core.cjs +5 -7
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +5 -7
- package/dev/dev.cjs +32 -27
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +32 -27
- package/invariantErrorCodes.js +32 -26
- package/package.json +19 -19
- package/react/context/ApolloConsumer.d.ts +1 -1
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/hooks/hooks.cjs +3 -0
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +3 -0
- package/react/hooks/useBackgroundQuery.d.ts +10 -13
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +2 -2
- package/react/hooks/useLoadableQuery.js +2 -1
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +3 -3
- package/react/hooks/useQueryRefHandlers.js +3 -2
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +2 -2
- package/react/hooks/useReadQuery.js +2 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +68 -6
- package/react/internal/cache/QueryReference.js +4 -0
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/index.d.ts +2 -2
- package/react/internal/index.js +1 -1
- package/react/internal/index.js.map +1 -1
- package/react/internal/internal.cjs +92 -0
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +92 -0
- package/react/parser/index.js +5 -5
- package/react/parser/parser.cjs +5 -5
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +5 -5
- package/react/query-preloader/createQueryPreloader.d.ts +6 -6
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/types/types.d.ts +2 -2
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +4 -4
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +4 -4
- package/testing/core/mocking/mockLink.js +5 -5
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/matchers/toBeDisposed.js +4 -13
- package/testing/matchers/toBeDisposed.js.map +1 -1
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +4 -4
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/utilities.cjs +19 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +19 -19
- package/version.js +1 -1
package/invariantErrorCodes.js
CHANGED
|
@@ -230,6 +230,12 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
230
230
|
},
|
|
231
231
|
|
|
232
232
|
59: {
|
|
233
|
+
file: "@apollo/client/react/internal/cache/QueryReference.js",
|
|
234
|
+
condition: "!queryRef || QUERY_REFERENCE_SYMBOL in queryRef",
|
|
235
|
+
message: "Expected a QueryRef object, but got something else instead."
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
60: {
|
|
233
239
|
file: "@apollo/client/react/parser/index.js",
|
|
234
240
|
condition: "!!document && !!document.kind",
|
|
235
241
|
|
|
@@ -238,7 +244,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
238
244
|
"to convert your operation into a document"
|
|
239
245
|
},
|
|
240
246
|
|
|
241
|
-
|
|
247
|
+
61: {
|
|
242
248
|
file: "@apollo/client/react/parser/index.js",
|
|
243
249
|
condition: "!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length",
|
|
244
250
|
|
|
@@ -246,7 +252,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
246
252
|
"You must include a query, subscription or mutation as well"
|
|
247
253
|
},
|
|
248
254
|
|
|
249
|
-
|
|
255
|
+
62: {
|
|
250
256
|
file: "@apollo/client/react/parser/index.js",
|
|
251
257
|
condition: "queries.length + mutations.length + subscriptions.length <= 1",
|
|
252
258
|
|
|
@@ -256,7 +262,7 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
256
262
|
"You can use 'compose' to join multiple operation types to a component"
|
|
257
263
|
},
|
|
258
264
|
|
|
259
|
-
|
|
265
|
+
63: {
|
|
260
266
|
file: "@apollo/client/react/parser/index.js",
|
|
261
267
|
condition: "definitions.length === 1",
|
|
262
268
|
|
|
@@ -265,120 +271,120 @@ export const errorCodes = // This file is used by the error message display webs
|
|
|
265
271
|
"You can use 'compose' to join multiple operation types to a component"
|
|
266
272
|
},
|
|
267
273
|
|
|
268
|
-
|
|
274
|
+
64: {
|
|
269
275
|
file: "@apollo/client/react/parser/index.js",
|
|
270
276
|
condition: "operation.type === type",
|
|
271
277
|
message: "Running a %s requires a graphql " + "%s, but a %s was used instead."
|
|
272
278
|
},
|
|
273
279
|
|
|
274
|
-
|
|
280
|
+
65: {
|
|
275
281
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
276
|
-
condition: "
|
|
282
|
+
condition: "queryWithoutClientOnlyDirectives",
|
|
277
283
|
message: "query is required"
|
|
278
284
|
},
|
|
279
285
|
|
|
280
|
-
|
|
286
|
+
66: {
|
|
281
287
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
282
288
|
condition: "mockedResponse.maxUsageCount > 0",
|
|
283
289
|
message: "Mock response maxUsageCount must be greater than 0, %s given"
|
|
284
290
|
},
|
|
285
291
|
|
|
286
|
-
|
|
292
|
+
67: {
|
|
287
293
|
file: "@apollo/client/utilities/graphql/DocumentTransform.js",
|
|
288
294
|
condition: "Array.isArray(cacheKeys)",
|
|
289
295
|
message: "`getCacheKey` must return an array or undefined"
|
|
290
296
|
},
|
|
291
297
|
|
|
292
|
-
|
|
298
|
+
68: {
|
|
293
299
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
294
300
|
condition: "evaledValue !== void 0",
|
|
295
301
|
message: "Invalid variable referenced in @%s directive."
|
|
296
302
|
},
|
|
297
303
|
|
|
298
|
-
|
|
304
|
+
69: {
|
|
299
305
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
300
306
|
condition: "directiveArguments && directiveArguments.length === 1",
|
|
301
307
|
message: "Incorrect number of arguments for the @%s directive."
|
|
302
308
|
},
|
|
303
309
|
|
|
304
|
-
|
|
310
|
+
70: {
|
|
305
311
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
306
312
|
condition: "ifArgument.name && ifArgument.name.value === \"if\"",
|
|
307
313
|
message: "Invalid argument for the @%s directive."
|
|
308
314
|
},
|
|
309
315
|
|
|
310
|
-
|
|
316
|
+
71: {
|
|
311
317
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
312
318
|
condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
|
|
313
319
|
message: "Argument for the @%s directive must be a variable or a boolean value."
|
|
314
320
|
},
|
|
315
321
|
|
|
316
|
-
|
|
322
|
+
72: {
|
|
317
323
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
318
324
|
|
|
319
325
|
message: "Found a %s operation%s. " +
|
|
320
326
|
"No operations are allowed when using a fragment as a query. Only fragments are allowed."
|
|
321
327
|
},
|
|
322
328
|
|
|
323
|
-
|
|
329
|
+
73: {
|
|
324
330
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
325
331
|
condition: "fragments.length === 1",
|
|
326
332
|
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
327
333
|
},
|
|
328
334
|
|
|
329
|
-
|
|
335
|
+
74: {
|
|
330
336
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
331
337
|
condition: "fragment",
|
|
332
338
|
message: "No fragment named %s"
|
|
333
339
|
},
|
|
334
340
|
|
|
335
|
-
|
|
341
|
+
75: {
|
|
336
342
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
337
343
|
condition: "doc && doc.kind === \"Document\"",
|
|
338
344
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
339
345
|
},
|
|
340
346
|
|
|
341
|
-
|
|
347
|
+
76: {
|
|
342
348
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
343
349
|
message: "Schema type definitions not allowed in queries. Found: \"%s\""
|
|
344
350
|
},
|
|
345
351
|
|
|
346
|
-
|
|
352
|
+
77: {
|
|
347
353
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
348
354
|
condition: "operations.length <= 1",
|
|
349
355
|
message: "Ambiguous GraphQL document: contains %s operations"
|
|
350
356
|
},
|
|
351
357
|
|
|
352
|
-
|
|
358
|
+
78: {
|
|
353
359
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
354
360
|
condition: "queryDef && queryDef.operation === \"query\"",
|
|
355
361
|
message: "Must contain a query definition."
|
|
356
362
|
},
|
|
357
363
|
|
|
358
|
-
|
|
364
|
+
79: {
|
|
359
365
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
360
366
|
condition: "doc.kind === \"Document\"",
|
|
361
367
|
message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
|
|
362
368
|
},
|
|
363
369
|
|
|
364
|
-
|
|
370
|
+
80: {
|
|
365
371
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
366
372
|
condition: "doc.definitions.length <= 1",
|
|
367
373
|
message: "Fragment must have exactly one definition."
|
|
368
374
|
},
|
|
369
375
|
|
|
370
|
-
|
|
376
|
+
81: {
|
|
371
377
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
372
378
|
condition: "fragmentDef.kind === \"FragmentDefinition\"",
|
|
373
379
|
message: "Must be a fragment definition."
|
|
374
380
|
},
|
|
375
381
|
|
|
376
|
-
|
|
382
|
+
82: {
|
|
377
383
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
378
384
|
message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
|
|
379
385
|
},
|
|
380
386
|
|
|
381
|
-
|
|
387
|
+
83: {
|
|
382
388
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
383
389
|
|
|
384
390
|
message: "The inline argument \"%s\" of kind \"%s\"" +
|
|
@@ -492,7 +498,7 @@ export const devWarn = {
|
|
|
492
498
|
message: "Using `returnPartialData` with a `no-cache` fetch policy has no effect. To read partial data from the cache, consider using an alternate fetch policy."
|
|
493
499
|
},
|
|
494
500
|
|
|
495
|
-
|
|
501
|
+
85: {
|
|
496
502
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
497
503
|
|
|
498
504
|
message: "Removing an @connection directive even though it does not have a key. " +
|
|
@@ -521,7 +527,7 @@ export const devError = {
|
|
|
521
527
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
522
528
|
},
|
|
523
529
|
|
|
524
|
-
|
|
530
|
+
84: {
|
|
525
531
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
526
532
|
message: "Could not find operation or fragment"
|
|
527
533
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apollo/client",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.4",
|
|
4
4
|
"description": "A fully-featured caching GraphQL client.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"@babel/parser": "7.24.5",
|
|
72
72
|
"@changesets/changelog-github": "0.5.0",
|
|
73
73
|
"@changesets/cli": "2.27.1",
|
|
74
|
-
"@graphql-tools/merge": "
|
|
74
|
+
"@graphql-tools/merge": "9.0.3",
|
|
75
75
|
"@graphql-tools/schema": "10.0.3",
|
|
76
|
-
"@graphql-tools/utils": "10.0
|
|
77
|
-
"@microsoft/api-extractor": "7.43.
|
|
76
|
+
"@graphql-tools/utils": "10.2.0",
|
|
77
|
+
"@microsoft/api-extractor": "7.43.2",
|
|
78
78
|
"@rollup/plugin-node-resolve": "11.2.1",
|
|
79
79
|
"@size-limit/esbuild-why": "11.1.2",
|
|
80
80
|
"@size-limit/preset-small-lib": "11.1.2",
|
|
81
|
-
"@testing-library/jest-dom": "6.4.
|
|
81
|
+
"@testing-library/jest-dom": "6.4.5",
|
|
82
82
|
"@testing-library/react": "15.0.6",
|
|
83
83
|
"@testing-library/react-12": "npm:@testing-library/react@^12",
|
|
84
84
|
"@testing-library/user-event": "14.5.2",
|
|
@@ -88,18 +88,18 @@
|
|
|
88
88
|
"@types/glob": "8.1.0",
|
|
89
89
|
"@types/hoist-non-react-statics": "3.3.5",
|
|
90
90
|
"@types/jest": "29.5.12",
|
|
91
|
-
"@types/lodash": "4.17.
|
|
92
|
-
"@types/node": "20.
|
|
91
|
+
"@types/lodash": "4.17.1",
|
|
92
|
+
"@types/node": "20.12.10",
|
|
93
93
|
"@types/node-fetch": "2.6.11",
|
|
94
|
-
"@types/react": "18.
|
|
95
|
-
"@types/react-dom": "18.
|
|
94
|
+
"@types/react": "18.3.1",
|
|
95
|
+
"@types/react-dom": "18.3.0",
|
|
96
96
|
"@types/relay-runtime": "14.1.23",
|
|
97
97
|
"@types/use-sync-external-store": "0.0.6",
|
|
98
|
-
"@typescript-eslint/eslint-plugin": "7.
|
|
99
|
-
"@typescript-eslint/parser": "7.
|
|
100
|
-
"@typescript-eslint/rule-tester": "7.
|
|
101
|
-
"@typescript-eslint/types": "7.
|
|
102
|
-
"@typescript-eslint/utils": "7.
|
|
98
|
+
"@typescript-eslint/eslint-plugin": "7.8.0",
|
|
99
|
+
"@typescript-eslint/parser": "7.8.0",
|
|
100
|
+
"@typescript-eslint/rule-tester": "7.8.0",
|
|
101
|
+
"@typescript-eslint/types": "7.8.0",
|
|
102
|
+
"@typescript-eslint/utils": "7.8.0",
|
|
103
103
|
"acorn": "8.11.3",
|
|
104
104
|
"blob-polyfill": "7.0.20220408",
|
|
105
105
|
"bytes": "3.1.2",
|
|
@@ -109,20 +109,20 @@
|
|
|
109
109
|
"eslint-plugin-import": "npm:@phryneas/eslint-plugin-import@2.27.5-pr.2813.2817.199971c",
|
|
110
110
|
"eslint-plugin-local-rules": "2.0.1",
|
|
111
111
|
"eslint-plugin-testing-library": "6.2.2",
|
|
112
|
-
"expect-type": "0.
|
|
112
|
+
"expect-type": "0.19.0",
|
|
113
113
|
"fetch-mock": "9.11.0",
|
|
114
114
|
"glob": "8.1.0",
|
|
115
115
|
"graphql": "16.8.1",
|
|
116
|
-
"graphql-ws": "5.
|
|
116
|
+
"graphql-ws": "5.16.0",
|
|
117
117
|
"jest": "29.7.0",
|
|
118
118
|
"jest-environment-jsdom": "29.7.0",
|
|
119
119
|
"jest-junit": "16.0.0",
|
|
120
120
|
"lodash": "4.17.21",
|
|
121
121
|
"patch-package": "8.0.0",
|
|
122
122
|
"prettier": "3.1.1",
|
|
123
|
-
"react": "18.
|
|
123
|
+
"react": "18.3.1",
|
|
124
124
|
"react-17": "npm:react@^17",
|
|
125
|
-
"react-dom": "18.
|
|
125
|
+
"react-dom": "18.3.1",
|
|
126
126
|
"react-dom-17": "npm:react-dom@^17",
|
|
127
127
|
"react-error-boundary": "4.0.13",
|
|
128
128
|
"recast": "0.23.6",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"rxjs": "7.8.1",
|
|
135
135
|
"size-limit": "11.1.2",
|
|
136
136
|
"subscriptions-transport-ws": "0.11.0",
|
|
137
|
-
"terser": "5.
|
|
137
|
+
"terser": "5.31.0",
|
|
138
138
|
"ts-api-utils": "1.3.0",
|
|
139
139
|
"ts-jest": "29.1.2",
|
|
140
140
|
"ts-jest-resolver": "2.0.1",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as ReactTypes from "react";
|
|
2
2
|
import type { ApolloClient } from "../../core/index.js";
|
|
3
3
|
export interface ApolloConsumerProps {
|
|
4
|
-
children: (client: ApolloClient<object>) => ReactTypes.
|
|
4
|
+
children: (client: ApolloClient<object>) => ReactTypes.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export declare const ApolloConsumer: ReactTypes.FC<ApolloConsumerProps>;
|
|
7
7
|
//# sourceMappingURL=ApolloConsumer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApolloConsumer.js","sourceRoot":"","sources":["../../../src/react/context/ApolloConsumer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAIjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,MAAM,CAAC,IAAM,cAAc,GAAuC,UAAC,KAAK;IACtE,IAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,QACpB,UAAC,OAAY;QACZ,SAAS,CACP,OAAO,IAAI,OAAO,CAAC,MAAM,EACzB,4DAA4D;YAC1D,iDAAiD,CACpD,CAAC;QACF,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC,CACsB,CAC1B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { invariant } from \"../../utilities/globals/index.js\";\n\nimport * as React from \"rehackt\";\nimport type * as ReactTypes from \"react\";\n\nimport type { ApolloClient } from \"../../core/index.js\";\nimport { getApolloContext } from \"./ApolloContext.js\";\n\nexport interface ApolloConsumerProps {\n children: (client: ApolloClient<object>) => ReactTypes.
|
|
1
|
+
{"version":3,"file":"ApolloConsumer.js","sourceRoot":"","sources":["../../../src/react/context/ApolloConsumer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAIjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,MAAM,CAAC,IAAM,cAAc,GAAuC,UAAC,KAAK;IACtE,IAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,QACpB,UAAC,OAAY;QACZ,SAAS,CACP,OAAO,IAAI,OAAO,CAAC,MAAM,EACzB,4DAA4D;YAC1D,iDAAiD,CACpD,CAAC;QACF,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC,CACsB,CAC1B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { invariant } from \"../../utilities/globals/index.js\";\n\nimport * as React from \"rehackt\";\nimport type * as ReactTypes from \"react\";\n\nimport type { ApolloClient } from \"../../core/index.js\";\nimport { getApolloContext } from \"./ApolloContext.js\";\n\nexport interface ApolloConsumerProps {\n children: (client: ApolloClient<object>) => ReactTypes.ReactNode;\n}\n\nexport const ApolloConsumer: ReactTypes.FC<ApolloConsumerProps> = (props) => {\n const ApolloContext = getApolloContext();\n return (\n <ApolloContext.Consumer>\n {(context: any) => {\n invariant(\n context && context.client,\n 'Could not find \"client\" in the context of ApolloConsumer. ' +\n \"Wrap the root component in an <ApolloProvider>.\"\n );\n return props.children(context.client);\n }}\n </ApolloContext.Consumer>\n );\n};\n"]}
|
package/react/hooks/hooks.cjs
CHANGED
|
@@ -975,6 +975,7 @@ function useLoadableQuery(query, options) {
|
|
|
975
975
|
var watchQueryOptions = useWatchQueryOptions({ client: client, query: query, options: options });
|
|
976
976
|
var _a = options.queryKey, queryKey = _a === void 0 ? [] : _a;
|
|
977
977
|
var _b = React__namespace.useState(null), queryRef = _b[0], setQueryRef = _b[1];
|
|
978
|
+
internal.assertWrappedQueryRef(queryRef);
|
|
978
979
|
var internalQueryRef = queryRef && internal.unwrapQueryRef(queryRef);
|
|
979
980
|
if (queryRef && (internalQueryRef === null || internalQueryRef === void 0 ? void 0 : internalQueryRef.didChangeOptions(watchQueryOptions))) {
|
|
980
981
|
var promise = internalQueryRef.applyOptions(watchQueryOptions);
|
|
@@ -1026,6 +1027,7 @@ function useQueryRefHandlers(queryRef) {
|
|
|
1026
1027
|
: useApolloClient())(queryRef);
|
|
1027
1028
|
}
|
|
1028
1029
|
function _useQueryRefHandlers(queryRef) {
|
|
1030
|
+
internal.assertWrappedQueryRef(queryRef);
|
|
1029
1031
|
var _a = React__namespace.useState(queryRef), previousQueryRef = _a[0], setPreviousQueryRef = _a[1];
|
|
1030
1032
|
var _b = React__namespace.useState(queryRef), wrappedQueryRef = _b[0], setWrappedQueryRef = _b[1];
|
|
1031
1033
|
var internalQueryRef = internal.unwrapQueryRef(queryRef);
|
|
@@ -1056,6 +1058,7 @@ function useReadQuery(queryRef) {
|
|
|
1056
1058
|
: useApolloClient())(queryRef);
|
|
1057
1059
|
}
|
|
1058
1060
|
function _useReadQuery(queryRef) {
|
|
1061
|
+
internal.assertWrappedQueryRef(queryRef);
|
|
1059
1062
|
var internalQueryRef = React__namespace.useMemo(function () { return internal.unwrapQueryRef(queryRef); }, [queryRef]);
|
|
1060
1063
|
var getPromise = React__namespace.useCallback(function () { return internal.getWrappedPromise(queryRef); }, [queryRef]);
|
|
1061
1064
|
if (internalQueryRef.disposed) {
|