@apollo/client 3.8.5 → 3.8.6
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/apollo-client.cjs +114 -74
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +46 -11
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +46 -11
- package/cache/core/types/common.d.ts +2 -2
- package/cache/core/types/common.d.ts.map +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +35 -0
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.js +3 -3
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.js +5 -5
- package/core/QueryManager.js +9 -9
- package/core/core.cjs +20 -20
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +20 -20
- package/dev/dev.cjs +97 -82
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +97 -82
- package/dev/loadErrorMessageHandler.js +1 -1
- package/dev/loadErrorMessageHandler.js.map +1 -1
- package/invariantErrorCodes.js +95 -80
- package/link/core/ApolloLink.js +2 -2
- package/link/core/core.cjs +2 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/http.cjs +3 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +3 -3
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/persisted-queries.cjs +2 -2
- package/link/persisted-queries/persisted-queries.cjs.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
- package/link/utils/toPromise.js +1 -1
- package/link/utils/utils.cjs +2 -2
- package/link/utils/utils.cjs.map +1 -1
- package/link/utils/utils.cjs.native.js +2 -2
- package/link/utils/validateOperation.js +1 -1
- package/package.json +21 -21
- package/react/cache/QueryReference.d.ts.map +1 -1
- package/react/cache/QueryReference.js +7 -2
- package/react/cache/QueryReference.js.map +1 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +3 -3
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +3 -3
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +2 -2
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +2 -2
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +15 -10
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +15 -10
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useReadQuery.js +1 -1
- package/react/hooks/useSubscription.js +2 -2
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- 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/testing/core/core.cjs +1 -1
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +1 -1
- package/testing/core/mocking/mockLink.js +1 -1
- package/testing/react/MockedProvider.d.ts +1 -0
- package/testing/react/MockedProvider.d.ts.map +1 -1
- package/testing/react/MockedProvider.js +2 -1
- package/testing/react/MockedProvider.js.map +1 -1
- package/testing/testing.cjs +2 -1
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +2 -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.d.ts +5 -0
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/index.d.ts +1 -1
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js.map +1 -1
- 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/dev/dev.cjs.native.js
CHANGED
|
@@ -15,45 +15,45 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
15
15
|
message: "store.merge expects a string ID"
|
|
16
16
|
},
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
4: {
|
|
19
19
|
file: "@apollo/client/cache/inmemory/key-extractor.js",
|
|
20
20
|
condition: "extracted !== void 0",
|
|
21
21
|
message: "Missing field '%s' while extracting keyFields from %s"
|
|
22
22
|
},
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
5: {
|
|
25
25
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
26
26
|
condition: "!old || old === which",
|
|
27
27
|
message: "Cannot change root %s __typename more than once"
|
|
28
28
|
},
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
8: {
|
|
31
31
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
32
32
|
message: "Cannot automatically merge arrays"
|
|
33
33
|
},
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
9: {
|
|
36
36
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
37
37
|
message: "No fragment named %s"
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
10: {
|
|
41
41
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
42
42
|
condition: "!isReference(value)",
|
|
43
43
|
message: "Missing selection set for object of type %s returned for query field %s"
|
|
44
44
|
},
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
11: {
|
|
47
47
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
48
48
|
message: "Could not identify object %s"
|
|
49
49
|
},
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
13: {
|
|
52
52
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
53
53
|
message: "No fragment named %s"
|
|
54
54
|
},
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
15: {
|
|
57
57
|
file: "@apollo/client/core/ApolloClient.js",
|
|
58
58
|
|
|
59
59
|
message: "To initialize Apollo Client, you must specify a 'cache' property " +
|
|
@@ -61,7 +61,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
61
61
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
62
62
|
},
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
16: {
|
|
65
65
|
file: "@apollo/client/core/ApolloClient.js",
|
|
66
66
|
condition: "options.fetchPolicy !== \"cache-and-network\"",
|
|
67
67
|
|
|
@@ -71,42 +71,42 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
71
71
|
"using a different fetchPolicy, such as cache-first or network-only."
|
|
72
72
|
},
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
18: {
|
|
75
75
|
file: "@apollo/client/core/LocalState.js",
|
|
76
76
|
condition: "fragment",
|
|
77
77
|
message: "No fragment named %s"
|
|
78
78
|
},
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
19: {
|
|
81
81
|
file: "@apollo/client/core/LocalState.js",
|
|
82
82
|
condition: "fragment",
|
|
83
83
|
message: "No fragment named %s"
|
|
84
84
|
},
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
22: {
|
|
87
87
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
88
88
|
condition: "pollInterval",
|
|
89
89
|
message: "Attempted to start a polling query without a polling interval."
|
|
90
90
|
},
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
25: {
|
|
93
93
|
file: "@apollo/client/core/QueryManager.js",
|
|
94
94
|
message: "QueryManager stopped while query was in flight"
|
|
95
95
|
},
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
26: {
|
|
98
98
|
file: "@apollo/client/core/QueryManager.js",
|
|
99
99
|
condition: "mutation",
|
|
100
100
|
message: "mutation option is required. You must specify your GraphQL document in the mutation option."
|
|
101
101
|
},
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
27: {
|
|
104
104
|
file: "@apollo/client/core/QueryManager.js",
|
|
105
105
|
condition: "fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\"",
|
|
106
106
|
message: "Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."
|
|
107
107
|
},
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
28: {
|
|
110
110
|
file: "@apollo/client/core/QueryManager.js",
|
|
111
111
|
condition: "options.query",
|
|
112
112
|
|
|
@@ -114,45 +114,45 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
114
114
|
"in the query option."
|
|
115
115
|
},
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
29: {
|
|
118
118
|
file: "@apollo/client/core/QueryManager.js",
|
|
119
119
|
condition: "options.query.kind === \"Document\"",
|
|
120
120
|
message: 'You must wrap the query string in a "gql" tag.'
|
|
121
121
|
},
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
30: {
|
|
124
124
|
file: "@apollo/client/core/QueryManager.js",
|
|
125
125
|
condition: "!options.returnPartialData",
|
|
126
126
|
message: "returnPartialData option only supported on watchQuery."
|
|
127
127
|
},
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
31: {
|
|
130
130
|
file: "@apollo/client/core/QueryManager.js",
|
|
131
131
|
condition: "!options.pollInterval",
|
|
132
132
|
message: "pollInterval option only supported on watchQuery."
|
|
133
133
|
},
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
32: {
|
|
136
136
|
file: "@apollo/client/core/QueryManager.js",
|
|
137
137
|
message: "Store reset while query was in flight (not completed in link chain)"
|
|
138
138
|
},
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
36: {
|
|
141
141
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
142
142
|
message: "request is not implemented"
|
|
143
143
|
},
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
37: {
|
|
146
146
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
147
147
|
message: "\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "
|
|
148
148
|
},
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
39: {
|
|
151
151
|
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
152
152
|
message: "Network request failed. %s is not serializable: %s"
|
|
153
153
|
},
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
40: {
|
|
156
156
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
157
157
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
158
158
|
|
|
@@ -161,18 +161,18 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
161
161
|
"parameter."
|
|
162
162
|
},
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
41: {
|
|
165
165
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
166
166
|
condition: "forward",
|
|
167
167
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
168
168
|
},
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
43: {
|
|
171
171
|
file: "@apollo/client/link/utils/validateOperation.js",
|
|
172
172
|
message: "illegal argument: %s"
|
|
173
173
|
},
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
44: {
|
|
176
176
|
file: "@apollo/client/react/context/ApolloConsumer.js",
|
|
177
177
|
condition: "context && context.client",
|
|
178
178
|
|
|
@@ -180,7 +180,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
180
180
|
"Wrap the root component in an <ApolloProvider>."
|
|
181
181
|
},
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
45: {
|
|
184
184
|
file: "@apollo/client/react/context/ApolloContext.js",
|
|
185
185
|
condition: "\"createContext\" in React",
|
|
186
186
|
|
|
@@ -190,7 +190,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
190
190
|
"For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
|
|
191
191
|
},
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
46: {
|
|
194
194
|
file: "@apollo/client/react/context/ApolloProvider.js",
|
|
195
195
|
condition: "context.client",
|
|
196
196
|
|
|
@@ -198,7 +198,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
198
198
|
'sure you pass in your client via the "client" prop.'
|
|
199
199
|
},
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
47: {
|
|
202
202
|
file: "@apollo/client/react/hoc/hoc-utils.js",
|
|
203
203
|
condition: "this.withRef",
|
|
204
204
|
|
|
@@ -206,7 +206,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
206
206
|
"{ withRef: true } in the options"
|
|
207
207
|
},
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
48: {
|
|
210
210
|
file: "@apollo/client/react/hoc/withApollo.js",
|
|
211
211
|
condition: "operationOptions.withRef",
|
|
212
212
|
|
|
@@ -214,7 +214,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
214
214
|
"{ withRef: true } in the options"
|
|
215
215
|
},
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
49: {
|
|
218
218
|
file: "@apollo/client/react/hooks/useApolloClient.js",
|
|
219
219
|
condition: "!!client",
|
|
220
220
|
|
|
@@ -223,7 +223,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
223
223
|
"instance in via options."
|
|
224
224
|
},
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
51: {
|
|
227
227
|
file: "@apollo/client/react/hooks/useReadQuery.js",
|
|
228
228
|
condition: "internalQueryRef.promiseCache",
|
|
229
229
|
|
|
@@ -232,13 +232,13 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
232
232
|
"Please ensure you are passing the `queryRef` returned from `useBackgroundQuery`."
|
|
233
233
|
},
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
56: {
|
|
236
236
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
237
237
|
condition: "supportedFetchPolicies.includes(fetchPolicy)",
|
|
238
238
|
message: "The fetch policy `%s` is not supported with suspense."
|
|
239
239
|
},
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
59: {
|
|
242
242
|
file: "@apollo/client/react/parser/index.js",
|
|
243
243
|
condition: "!!document && !!document.kind",
|
|
244
244
|
|
|
@@ -247,7 +247,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
247
247
|
"to convert your operation into a document"
|
|
248
248
|
},
|
|
249
249
|
|
|
250
|
-
|
|
250
|
+
60: {
|
|
251
251
|
file: "@apollo/client/react/parser/index.js",
|
|
252
252
|
condition: "!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length",
|
|
253
253
|
|
|
@@ -255,7 +255,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
255
255
|
"You must include a query, subscription or mutation as well"
|
|
256
256
|
},
|
|
257
257
|
|
|
258
|
-
|
|
258
|
+
61: {
|
|
259
259
|
file: "@apollo/client/react/parser/index.js",
|
|
260
260
|
condition: "queries.length + mutations.length + subscriptions.length <= 1",
|
|
261
261
|
|
|
@@ -265,7 +265,7 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
265
265
|
"You can use 'compose' to join multiple operation types to a component"
|
|
266
266
|
},
|
|
267
267
|
|
|
268
|
-
|
|
268
|
+
62: {
|
|
269
269
|
file: "@apollo/client/react/parser/index.js",
|
|
270
270
|
condition: "definitions.length === 1",
|
|
271
271
|
|
|
@@ -274,114 +274,114 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
274
274
|
"You can use 'compose' to join multiple operation types to a component"
|
|
275
275
|
},
|
|
276
276
|
|
|
277
|
-
|
|
277
|
+
63: {
|
|
278
278
|
file: "@apollo/client/react/parser/index.js",
|
|
279
279
|
condition: "operation.type === type",
|
|
280
280
|
message: "Running a %s requires a graphql " + "%s, but a %s was used instead."
|
|
281
281
|
},
|
|
282
282
|
|
|
283
|
-
|
|
283
|
+
64: {
|
|
284
284
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
285
285
|
condition: "queryWithoutConnection",
|
|
286
286
|
message: "query is required"
|
|
287
287
|
},
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
65: {
|
|
290
290
|
file: "@apollo/client/utilities/graphql/DocumentTransform.js",
|
|
291
291
|
condition: "Array.isArray(cacheKeys)",
|
|
292
292
|
message: "`getCacheKey` must return an array or undefined"
|
|
293
293
|
},
|
|
294
294
|
|
|
295
|
-
|
|
295
|
+
66: {
|
|
296
296
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
297
297
|
condition: "evaledValue !== void 0",
|
|
298
298
|
message: "Invalid variable referenced in @%s directive."
|
|
299
299
|
},
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
67: {
|
|
302
302
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
303
303
|
condition: "directiveArguments && directiveArguments.length === 1",
|
|
304
304
|
message: "Incorrect number of arguments for the @%s directive."
|
|
305
305
|
},
|
|
306
306
|
|
|
307
|
-
|
|
307
|
+
68: {
|
|
308
308
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
309
309
|
condition: "ifArgument.name && ifArgument.name.value === \"if\"",
|
|
310
310
|
message: "Invalid argument for the @%s directive."
|
|
311
311
|
},
|
|
312
312
|
|
|
313
|
-
|
|
313
|
+
69: {
|
|
314
314
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
315
315
|
condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
|
|
316
316
|
message: "Argument for the @%s directive must be a variable or a boolean value."
|
|
317
317
|
},
|
|
318
318
|
|
|
319
|
-
|
|
319
|
+
70: {
|
|
320
320
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
321
321
|
|
|
322
322
|
message: "Found a %s operation%s. " +
|
|
323
323
|
"No operations are allowed when using a fragment as a query. Only fragments are allowed."
|
|
324
324
|
},
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
71: {
|
|
327
327
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
328
328
|
condition: "fragments.length === 1",
|
|
329
329
|
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
330
330
|
},
|
|
331
331
|
|
|
332
|
-
|
|
332
|
+
72: {
|
|
333
333
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
334
334
|
condition: "fragment",
|
|
335
335
|
message: "No fragment named %s"
|
|
336
336
|
},
|
|
337
337
|
|
|
338
|
-
|
|
338
|
+
73: {
|
|
339
339
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
340
340
|
condition: "doc && doc.kind === \"Document\"",
|
|
341
341
|
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"
|
|
342
342
|
},
|
|
343
343
|
|
|
344
|
-
|
|
344
|
+
74: {
|
|
345
345
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
346
346
|
message: "Schema type definitions not allowed in queries. Found: \"%s\""
|
|
347
347
|
},
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
75: {
|
|
350
350
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
351
351
|
condition: "operations.length <= 1",
|
|
352
352
|
message: "Ambiguous GraphQL document: contains %s operations"
|
|
353
353
|
},
|
|
354
354
|
|
|
355
|
-
|
|
355
|
+
76: {
|
|
356
356
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
357
357
|
condition: "queryDef && queryDef.operation === \"query\"",
|
|
358
358
|
message: "Must contain a query definition."
|
|
359
359
|
},
|
|
360
360
|
|
|
361
|
-
|
|
361
|
+
77: {
|
|
362
362
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
363
363
|
condition: "doc.kind === \"Document\"",
|
|
364
364
|
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"
|
|
365
365
|
},
|
|
366
366
|
|
|
367
|
-
|
|
367
|
+
78: {
|
|
368
368
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
369
369
|
condition: "doc.definitions.length <= 1",
|
|
370
370
|
message: "Fragment must have exactly one definition."
|
|
371
371
|
},
|
|
372
372
|
|
|
373
|
-
|
|
373
|
+
79: {
|
|
374
374
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
375
375
|
condition: "fragmentDef.kind === \"FragmentDefinition\"",
|
|
376
376
|
message: "Must be a fragment definition."
|
|
377
377
|
},
|
|
378
378
|
|
|
379
|
-
|
|
379
|
+
80: {
|
|
380
380
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
381
381
|
message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
|
|
382
382
|
},
|
|
383
383
|
|
|
384
|
-
|
|
384
|
+
81: {
|
|
385
385
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
386
386
|
|
|
387
387
|
message: "The inline argument \"%s\" of kind \"%s\"" +
|
|
@@ -391,12 +391,12 @@ const errorCodes = // This file is used by the error message display website and
|
|
|
391
391
|
};
|
|
392
392
|
|
|
393
393
|
const devDebug = {
|
|
394
|
-
|
|
394
|
+
17: {
|
|
395
395
|
file: "@apollo/client/core/ApolloClient.js",
|
|
396
396
|
message: "In client.refetchQueries, Promise.all promise rejected with error %o"
|
|
397
397
|
},
|
|
398
398
|
|
|
399
|
-
|
|
399
|
+
24: {
|
|
400
400
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
401
401
|
message: "Missing cache result fields: %o"
|
|
402
402
|
}
|
|
@@ -405,82 +405,97 @@ const devDebug = {
|
|
|
405
405
|
const devLog = {};
|
|
406
406
|
|
|
407
407
|
const devWarn = {
|
|
408
|
-
|
|
408
|
+
2: {
|
|
409
|
+
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
410
|
+
|
|
411
|
+
message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
|
|
412
|
+
"Please make sure to set the `mergeIntoStore` parameter to `true` when creating a Reference that is not part of the store yet:\n" +
|
|
413
|
+
"`toReference(object, true)`"
|
|
414
|
+
},
|
|
415
|
+
|
|
416
|
+
3: {
|
|
417
|
+
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
418
|
+
|
|
419
|
+
message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
|
|
420
|
+
"Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
|
|
421
|
+
},
|
|
422
|
+
|
|
423
|
+
6: {
|
|
409
424
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
410
425
|
message: "Inferring subtype %s of supertype %s"
|
|
411
426
|
},
|
|
412
427
|
|
|
413
|
-
|
|
428
|
+
7: {
|
|
414
429
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
415
430
|
message: "Undefined 'from' passed to readField with arguments %s"
|
|
416
431
|
},
|
|
417
432
|
|
|
418
|
-
|
|
433
|
+
14: {
|
|
419
434
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
420
435
|
message: "Cache data may be lost when replacing the %s field of a %s object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:\n\n existing: %s\n incoming: %s\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"
|
|
421
436
|
},
|
|
422
437
|
|
|
423
|
-
|
|
438
|
+
20: {
|
|
424
439
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
425
440
|
message: "Called refetch(%o) for query %o, which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"
|
|
426
441
|
},
|
|
427
442
|
|
|
428
|
-
|
|
443
|
+
33: {
|
|
429
444
|
file: "@apollo/client/core/QueryManager.js",
|
|
430
445
|
message: "Unknown query named \"%s\" requested in refetchQueries options.include array"
|
|
431
446
|
},
|
|
432
447
|
|
|
433
|
-
|
|
448
|
+
34: {
|
|
434
449
|
file: "@apollo/client/core/QueryManager.js",
|
|
435
450
|
message: "Unknown query %s requested in refetchQueries options.include array"
|
|
436
451
|
},
|
|
437
452
|
|
|
438
|
-
|
|
453
|
+
35: {
|
|
439
454
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
440
455
|
message: "You are calling concat on a terminating link, which will have no effect %o"
|
|
441
456
|
},
|
|
442
457
|
|
|
443
|
-
|
|
458
|
+
38: {
|
|
444
459
|
file: "@apollo/client/link/http/createHttpLink.js",
|
|
445
460
|
message: "Multipart-subscriptions do not support @defer"
|
|
446
461
|
},
|
|
447
462
|
|
|
448
|
-
|
|
463
|
+
42: {
|
|
449
464
|
file: "@apollo/client/link/utils/toPromise.js",
|
|
450
465
|
message: "Promise Wrapper does not support multiple results from Observable"
|
|
451
466
|
},
|
|
452
467
|
|
|
453
|
-
|
|
468
|
+
50: {
|
|
454
469
|
file: "@apollo/client/react/hooks/useQuery.js",
|
|
455
470
|
message: "Calling default no-op implementation of InternalState#forceUpdate"
|
|
456
471
|
},
|
|
457
472
|
|
|
458
|
-
|
|
473
|
+
52: {
|
|
459
474
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
460
475
|
message: "'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used."
|
|
461
476
|
},
|
|
462
477
|
|
|
463
|
-
|
|
478
|
+
53: {
|
|
464
479
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
465
480
|
message: "'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead."
|
|
466
481
|
},
|
|
467
482
|
|
|
468
|
-
|
|
483
|
+
54: {
|
|
469
484
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
470
485
|
message: "'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used."
|
|
471
486
|
},
|
|
472
487
|
|
|
473
|
-
|
|
488
|
+
55: {
|
|
474
489
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
475
490
|
message: "'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead."
|
|
476
491
|
},
|
|
477
492
|
|
|
478
|
-
|
|
493
|
+
57: {
|
|
479
494
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
480
495
|
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."
|
|
481
496
|
},
|
|
482
497
|
|
|
483
|
-
|
|
498
|
+
83: {
|
|
484
499
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
485
500
|
|
|
486
501
|
message: "Removing an @connection directive even though it does not have a key. " +
|
|
@@ -489,33 +504,33 @@ const devWarn = {
|
|
|
489
504
|
};
|
|
490
505
|
|
|
491
506
|
const devError = {
|
|
492
|
-
|
|
507
|
+
12: {
|
|
493
508
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
494
509
|
message: "Missing field '%s' while writing result %o"
|
|
495
510
|
},
|
|
496
511
|
|
|
497
|
-
|
|
512
|
+
21: {
|
|
498
513
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
499
514
|
message: "Unhandled GraphQL subscription error"
|
|
500
515
|
},
|
|
501
516
|
|
|
502
|
-
|
|
517
|
+
23: {
|
|
503
518
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
504
519
|
message: "Unhandled error"
|
|
505
520
|
},
|
|
506
521
|
|
|
507
|
-
|
|
522
|
+
58: {
|
|
508
523
|
file: "@apollo/client/react/hooks/useSyncExternalStore.js",
|
|
509
524
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
510
525
|
},
|
|
511
526
|
|
|
512
|
-
|
|
527
|
+
82: {
|
|
513
528
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
514
529
|
message: "Could not find operation or fragment"
|
|
515
530
|
}
|
|
516
531
|
};
|
|
517
532
|
|
|
518
|
-
var version = "3.8.
|
|
533
|
+
var version = "3.8.6";
|
|
519
534
|
|
|
520
535
|
function maybe(thunk) {
|
|
521
536
|
try {
|
|
@@ -619,7 +634,7 @@ function loadErrorMessageHandler() {
|
|
|
619
634
|
function handler(message, args) {
|
|
620
635
|
if (typeof message === "number") {
|
|
621
636
|
var definition = globals.global[ApolloErrorMessageHandler][message];
|
|
622
|
-
if (!message || !definition.message)
|
|
637
|
+
if (!message || !(definition === null || definition === void 0 ? void 0 : definition.message))
|
|
623
638
|
return;
|
|
624
639
|
message = definition.message;
|
|
625
640
|
}
|
|
@@ -16,7 +16,7 @@ export function loadErrorMessageHandler() {
|
|
|
16
16
|
function handler(message, args) {
|
|
17
17
|
if (typeof message === "number") {
|
|
18
18
|
var definition = global[ApolloErrorMessageHandler][message];
|
|
19
|
-
if (!message || !definition.message)
|
|
19
|
+
if (!message || !(definition === null || definition === void 0 ? void 0 : definition.message))
|
|
20
20
|
return;
|
|
21
21
|
message = definition.message;
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadErrorMessageHandler.js","sourceRoot":"","sources":["../../src/dev/loadErrorMessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,MAAM,UAAU,uBAAuB;IAAC,oBAA2B;SAA3B,UAA2B,EAA3B,qBAA2B,EAA3B,IAA2B;QAA3B,+BAA2B;;IACjE,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE;QACtC,MAAM,CAAC,yBAAyB,CAAC,GAAG,OAAsC,CAAC;KAC5E;IAED,KAAoB,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU,EAAE;QAA3B,IAAM,KAAK,mBAAA;QACd,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE,KAAK,CAAC,CAAC;KACzD;IAED,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAC;IAEzC,SAAS,OAAO,CAAC,OAAwB,EAAE,IAAe;QACxD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,IAAM,UAAU,GAAG,MAAM,CAAC,yBAAyB,CAAE,CAAC,OAAO,CAAC,CAAC;YAC/D,IAAI,CAAC,OAAO,IAAI,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"loadErrorMessageHandler.js","sourceRoot":"","sources":["../../src/dev/loadErrorMessageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,MAAM,UAAU,uBAAuB;IAAC,oBAA2B;SAA3B,UAA2B,EAA3B,qBAA2B,EAA3B,IAA2B;QAA3B,+BAA2B;;IACjE,IAAI,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE;QACtC,MAAM,CAAC,yBAAyB,CAAC,GAAG,OAAsC,CAAC;KAC5E;IAED,KAAoB,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU,EAAE;QAA3B,IAAM,KAAK,mBAAA;QACd,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAE,KAAK,CAAC,CAAC;KACzD;IAED,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAC;IAEzC,SAAS,OAAO,CAAC,OAAwB,EAAE,IAAe;QACxD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,IAAM,UAAU,GAAG,MAAM,CAAC,yBAAyB,CAAE,CAAC,OAAO,CAAC,CAAC;YAC/D,IAAI,CAAC,OAAO,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,CAAA;gBAAE,OAAO;YAC7C,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;SAC9B;QACD,OAAO,IAAI,CAAC,MAAM,CAChB,UAAC,GAAG,EAAE,GAAG,IAAK,OAAA,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAnC,CAAmC,EACjD,MAAM,CAAC,OAAO,CAAC,CAChB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type { ErrorCodes } from \"../invariantErrorCodes.js\";\nimport { global } from \"../utilities/globals/index.js\";\nimport { ApolloErrorMessageHandler } from \"../utilities/globals/invariantWrappers.js\";\n\nexport function loadErrorMessageHandler(...errorCodes: ErrorCodes[]) {\n if (!global[ApolloErrorMessageHandler]) {\n global[ApolloErrorMessageHandler] = handler as typeof handler & ErrorCodes;\n }\n\n for (const codes of errorCodes) {\n Object.assign(global[ApolloErrorMessageHandler], codes);\n }\n\n return global[ApolloErrorMessageHandler];\n\n function handler(message: string | number, args: unknown[]) {\n if (typeof message === \"number\") {\n const definition = global[ApolloErrorMessageHandler]![message];\n if (!message || !definition?.message) return;\n message = definition.message;\n }\n return args.reduce<string>(\n (msg, arg) => msg.replace(/%[sdfo]/, String(arg)),\n String(message)\n );\n }\n}\n"]}
|