@apollo/client 4.0.0-alpha.5 → 4.0.0-alpha.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/.changeset/giant-bags-share.md +5 -0
- package/.changeset/nervous-fireants-bow.md +5 -0
- package/.changeset/pre.json +4 -0
- package/.changeset/tame-points-work.md +11 -0
- package/.changeset/tender-swans-flash.md +16 -0
- package/CHANGELOG.md +32 -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/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs +3 -1
- package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs.map +1 -1
- package/__cjs/config/jest/setup.cjs +6 -0
- package/__cjs/config/jest/setup.cjs.map +1 -1
- package/__cjs/core/ApolloClient.cjs +9 -3
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +5 -5
- package/__cjs/core/LocalState.cjs +2 -2
- package/__cjs/core/ObservableQuery.cjs +15 -10
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +6 -6
- package/__cjs/core/QueryManager.cjs +34 -25
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +4 -4
- package/__cjs/core/types.d.cts +24 -2
- package/__cjs/errors/CombinedGraphQLErrors.cjs +8 -1
- package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedGraphQLErrors.d.cts +7 -2
- package/__cjs/invariantErrorCodes.cjs +110 -88
- package/__cjs/link/core/ApolloLink.cjs +2 -2
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/createHttpLink.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/subscriptions/index.cjs +3 -1
- package/__cjs/link/subscriptions/index.cjs.map +1 -1
- package/__cjs/link/utils/validateOperation.cjs +1 -1
- package/__cjs/masking/maskDefinition.cjs +2 -2
- package/__cjs/masking/maskFragment.cjs +2 -2
- package/__cjs/masking/maskOperation.cjs +1 -1
- package/__cjs/masking/utils.cjs +1 -1
- package/__cjs/react/context/ApolloConsumer.cjs +1 -1
- package/__cjs/react/context/ApolloContext.cjs +1 -1
- package/__cjs/react/context/ApolloProvider.cjs +1 -1
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +4 -4
- package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +3 -3
- package/__cjs/react/hooks/useSubscription.cjs +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs +2 -2
- package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +3 -3
- package/__cjs/react/internal/types.d.cts +2 -2
- package/__cjs/react/parser/index.cjs +5 -5
- package/__cjs/react/ssr/getDataFromTree.cjs +23 -60
- package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -1
- package/__cjs/react/ssr/getDataFromTree.d.cts +12 -6
- package/__cjs/react/ssr/index.cjs +3 -1
- package/__cjs/react/ssr/index.cjs.map +1 -1
- package/__cjs/react/ssr/index.d.cts +1 -0
- package/__cjs/react/ssr/prerenderStatic.cjs +151 -0
- package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -0
- package/__cjs/react/ssr/prerenderStatic.d.cts +122 -0
- package/__cjs/react/ssr/renderToStringWithData.cjs +11 -5
- package/__cjs/react/ssr/renderToStringWithData.cjs.map +1 -1
- package/__cjs/react/ssr/renderToStringWithData.d.cts +5 -0
- package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
- package/__cjs/react/ssr/useSSRQuery.d.cts +2 -2
- package/__cjs/testing/internal/index.cjs +3 -1
- package/__cjs/testing/internal/index.cjs.map +1 -1
- package/__cjs/testing/internal/index.d.cts +1 -0
- package/__cjs/testing/internal/resetApolloContext.cjs +24 -0
- package/__cjs/testing/internal/resetApolloContext.cjs.map +1 -0
- package/__cjs/testing/internal/resetApolloContext.d.cts +10 -0
- package/__cjs/utilities/internal/index.cjs +3 -1
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +1 -0
- package/__cjs/utilities/internal/toQueryResult.cjs +13 -0
- package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -0
- package/__cjs/utilities/internal/toQueryResult.d.cts +3 -0
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.d.cts +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/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/config/jest/areCombinedGraphQLErrorsEqual.js +3 -1
- package/config/jest/areCombinedGraphQLErrorsEqual.js.map +1 -1
- package/config/jest/setup.js +6 -0
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.d.ts +5 -5
- package/core/ApolloClient.js +9 -3
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.d.ts +6 -6
- package/core/ObservableQuery.js +15 -10
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.d.ts +4 -4
- package/core/QueryManager.js +35 -26
- package/core/QueryManager.js.map +1 -1
- package/core/types.d.ts +24 -2
- package/errors/CombinedGraphQLErrors.d.ts +7 -2
- package/errors/CombinedGraphQLErrors.js +8 -1
- package/errors/CombinedGraphQLErrors.js.map +1 -1
- package/invariantErrorCodes.js +110 -88
- package/link/core/ApolloLink.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/subscriptions/index.js +3 -1
- package/link/subscriptions/index.js.map +1 -1
- package/link/utils/validateOperation.js +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/utils.js +1 -1
- package/package.json +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/hooks/useApolloClient.js +1 -1
- package/react/hooks/useLazyQuery.d.ts +4 -4
- package/react/hooks/useLazyQuery.js +2 -2
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useQuery.d.ts +3 -3
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.js +1 -1
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.d.ts +3 -3
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/types.d.ts +2 -2
- package/react/parser/index.js +5 -5
- package/react/ssr/getDataFromTree.d.ts +12 -6
- package/react/ssr/getDataFromTree.js +23 -59
- package/react/ssr/getDataFromTree.js.map +1 -1
- package/react/ssr/index.d.ts +1 -0
- package/react/ssr/index.js +1 -0
- package/react/ssr/index.js.map +1 -1
- package/react/ssr/prerenderStatic.d.ts +122 -0
- package/react/ssr/prerenderStatic.js +147 -0
- package/react/ssr/prerenderStatic.js.map +1 -0
- package/react/ssr/renderToStringWithData.d.ts +5 -0
- package/react/ssr/renderToStringWithData.js +11 -5
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/ssr/useSSRQuery.d.ts +2 -2
- package/react/ssr/useSSRQuery.js.map +1 -1
- package/testing/internal/index.d.ts +1 -0
- package/testing/internal/index.js +2 -1
- package/testing/internal/index.js.map +1 -1
- package/testing/internal/resetApolloContext.d.ts +10 -0
- package/testing/internal/resetApolloContext.js +20 -0
- package/testing/internal/resetApolloContext.js.map +1 -0
- package/utilities/internal/index.d.ts +1 -0
- package/utilities/internal/index.js +2 -1
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/toQueryResult.d.ts +3 -0
- package/utilities/internal/toQueryResult.js +10 -0
- package/utilities/internal/toQueryResult.js.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/__cjs/utilities/types/TODO.cjs +0 -3
- package/__cjs/utilities/types/TODO.cjs.map +0 -1
- package/__cjs/utilities/types/TODO.d.cts +0 -3
- package/utilities/types/TODO.d.ts +0 -3
- package/utilities/types/TODO.js +0 -2
- package/utilities/types/TODO.js.map +0 -1
|
@@ -122,6 +122,22 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
122
122
|
},
|
|
123
123
|
|
|
124
124
|
25: {
|
|
125
|
+
file: "@apollo/client/__cjs/react/ssr/prerenderStatic.cjs",
|
|
126
|
+
condition: "renderCount <= maxRerenders",
|
|
127
|
+
|
|
128
|
+
message: `Exceeded maximum rerender count of %d.
|
|
129
|
+
This either means you have very deep \`useQuery\` waterfalls in your application
|
|
130
|
+
and need to increase the \`maxRerender\` option to \`prerenderStatic\`, or that
|
|
131
|
+
you have an infinite render loop in your application.`
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
26: {
|
|
135
|
+
file: "@apollo/client/__cjs/react/ssr/prerenderStatic.cjs",
|
|
136
|
+
condition: "!signal?.aborted",
|
|
137
|
+
message: "The operation was aborted before it could be attempted."
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
27: {
|
|
125
141
|
file: "@apollo/client/__cjs/react/parser/index.cjs",
|
|
126
142
|
condition: "!!document && !!document.kind",
|
|
127
143
|
|
|
@@ -130,7 +146,7 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
130
146
|
`to convert your operation into a document`
|
|
131
147
|
},
|
|
132
148
|
|
|
133
|
-
|
|
149
|
+
28: {
|
|
134
150
|
file: "@apollo/client/__cjs/react/parser/index.cjs",
|
|
135
151
|
condition: "!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length",
|
|
136
152
|
|
|
@@ -138,7 +154,7 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
138
154
|
`You must include a query, subscription or mutation as well`
|
|
139
155
|
},
|
|
140
156
|
|
|
141
|
-
|
|
157
|
+
29: {
|
|
142
158
|
file: "@apollo/client/__cjs/react/parser/index.cjs",
|
|
143
159
|
condition: "queries.length + mutations.length + subscriptions.length <= 1",
|
|
144
160
|
|
|
@@ -148,7 +164,7 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
148
164
|
`You can use 'compose' to join multiple operation types to a component`
|
|
149
165
|
},
|
|
150
166
|
|
|
151
|
-
|
|
167
|
+
30: {
|
|
152
168
|
file: "@apollo/client/__cjs/react/parser/index.cjs",
|
|
153
169
|
condition: "definitions.length === 1",
|
|
154
170
|
|
|
@@ -157,19 +173,19 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
157
173
|
`You can use 'compose' to join multiple operation types to a component`
|
|
158
174
|
},
|
|
159
175
|
|
|
160
|
-
|
|
176
|
+
31: {
|
|
161
177
|
file: "@apollo/client/__cjs/react/parser/index.cjs",
|
|
162
178
|
condition: "operation.type === type",
|
|
163
179
|
message: `Running a %s requires a graphql ` + `%s, but a %s was used instead.`
|
|
164
180
|
},
|
|
165
181
|
|
|
166
|
-
|
|
182
|
+
32: {
|
|
167
183
|
file: "@apollo/client/__cjs/react/internal/cache/QueryReference.cjs",
|
|
168
184
|
condition: "!queryRef || QUERY_REFERENCE_SYMBOL in queryRef",
|
|
169
185
|
message: "Expected a QueryRef object, but got something else instead."
|
|
170
186
|
},
|
|
171
187
|
|
|
172
|
-
|
|
188
|
+
33: {
|
|
173
189
|
file: "@apollo/client/__cjs/react/hooks/useApolloClient.cjs",
|
|
174
190
|
condition: "!!client",
|
|
175
191
|
|
|
@@ -178,43 +194,43 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
178
194
|
"instance in via options."
|
|
179
195
|
},
|
|
180
196
|
|
|
181
|
-
|
|
197
|
+
34: {
|
|
182
198
|
file: "@apollo/client/__cjs/react/hooks/useLazyQuery.cjs",
|
|
183
199
|
condition: "resultRef.current",
|
|
184
200
|
message: "useLazyQuery: '%s' cannot be called before executing the query."
|
|
185
201
|
},
|
|
186
202
|
|
|
187
|
-
|
|
203
|
+
35: {
|
|
188
204
|
file: "@apollo/client/__cjs/react/hooks/useLazyQuery.cjs",
|
|
189
205
|
condition: "!calledDuringRender()",
|
|
190
206
|
message: "useLazyQuery: 'execute' should not be called during render. To start a query during render, use the 'useQuery' hook."
|
|
191
207
|
},
|
|
192
208
|
|
|
193
|
-
|
|
209
|
+
36: {
|
|
194
210
|
file: "@apollo/client/__cjs/react/hooks/useLoadableQuery.cjs",
|
|
195
211
|
condition: "!calledDuringRender()",
|
|
196
212
|
message: "useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook."
|
|
197
213
|
},
|
|
198
214
|
|
|
199
|
-
|
|
215
|
+
37: {
|
|
200
216
|
file: "@apollo/client/__cjs/react/hooks/useLoadableQuery.cjs",
|
|
201
217
|
condition: "internalQueryRef",
|
|
202
218
|
message: "The query has not been loaded. Please load the query."
|
|
203
219
|
},
|
|
204
220
|
|
|
205
|
-
|
|
221
|
+
38: {
|
|
206
222
|
file: "@apollo/client/__cjs/react/hooks/useSubscription.cjs",
|
|
207
223
|
condition: "!optionsRef.current.skip",
|
|
208
224
|
message: "A subscription that is skipped cannot be restarted."
|
|
209
225
|
},
|
|
210
226
|
|
|
211
|
-
|
|
227
|
+
39: {
|
|
212
228
|
file: "@apollo/client/__cjs/react/hooks/useSuspenseQuery.cjs",
|
|
213
229
|
condition: "supportedFetchPolicies.includes(fetchPolicy)",
|
|
214
230
|
message: `The fetch policy \`%s\` is not supported with suspense.`
|
|
215
231
|
},
|
|
216
232
|
|
|
217
|
-
|
|
233
|
+
42: {
|
|
218
234
|
file: "@apollo/client/__cjs/react/context/ApolloConsumer.cjs",
|
|
219
235
|
condition: "context && context.client",
|
|
220
236
|
|
|
@@ -222,7 +238,7 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
222
238
|
"Wrap the root component in an <ApolloProvider>."
|
|
223
239
|
},
|
|
224
240
|
|
|
225
|
-
|
|
241
|
+
43: {
|
|
226
242
|
file: "@apollo/client/__cjs/react/context/ApolloContext.cjs",
|
|
227
243
|
condition: "\"createContext\" in React",
|
|
228
244
|
|
|
@@ -233,7 +249,7 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
233
249
|
"For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
|
|
234
250
|
},
|
|
235
251
|
|
|
236
|
-
|
|
252
|
+
44: {
|
|
237
253
|
file: "@apollo/client/__cjs/react/context/ApolloProvider.cjs",
|
|
238
254
|
condition: "context.client",
|
|
239
255
|
|
|
@@ -241,36 +257,36 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
241
257
|
'sure you pass in your client via the "client" prop.'
|
|
242
258
|
},
|
|
243
259
|
|
|
244
|
-
|
|
260
|
+
45: {
|
|
245
261
|
file: "@apollo/client/__cjs/masking/maskDefinition.cjs",
|
|
246
262
|
condition: "fragment",
|
|
247
263
|
message: "Could not find fragment with name '%s'."
|
|
248
264
|
},
|
|
249
265
|
|
|
250
|
-
|
|
266
|
+
47: {
|
|
251
267
|
file: "@apollo/client/__cjs/masking/maskFragment.cjs",
|
|
252
268
|
condition: "fragments.length === 1",
|
|
253
269
|
message: `Found %s fragments. \`fragmentName\` must be provided when there is not exactly 1 fragment.`
|
|
254
270
|
},
|
|
255
271
|
|
|
256
|
-
|
|
272
|
+
48: {
|
|
257
273
|
file: "@apollo/client/__cjs/masking/maskFragment.cjs",
|
|
258
274
|
condition: "!!fragment",
|
|
259
275
|
message: `Could not find fragment with name "%s".`
|
|
260
276
|
},
|
|
261
277
|
|
|
262
|
-
|
|
278
|
+
49: {
|
|
263
279
|
file: "@apollo/client/__cjs/masking/maskOperation.cjs",
|
|
264
280
|
condition: "definition",
|
|
265
281
|
message: "Expected a parsed GraphQL document with a query, mutation, or subscription."
|
|
266
282
|
},
|
|
267
283
|
|
|
268
|
-
|
|
284
|
+
51: {
|
|
269
285
|
file: "@apollo/client/__cjs/link/utils/validateOperation.cjs",
|
|
270
286
|
message: `illegal argument: %s`
|
|
271
287
|
},
|
|
272
288
|
|
|
273
|
-
|
|
289
|
+
52: {
|
|
274
290
|
file: "@apollo/client/__cjs/link/persisted-queries/index.cjs",
|
|
275
291
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
276
292
|
|
|
@@ -279,13 +295,13 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
279
295
|
"parameter."
|
|
280
296
|
},
|
|
281
297
|
|
|
282
|
-
|
|
298
|
+
53: {
|
|
283
299
|
file: "@apollo/client/__cjs/link/persisted-queries/index.cjs",
|
|
284
300
|
condition: "forward",
|
|
285
301
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
286
302
|
},
|
|
287
303
|
|
|
288
|
-
|
|
304
|
+
54: {
|
|
289
305
|
file: "@apollo/client/__cjs/link/http/checkFetcher.cjs",
|
|
290
306
|
condition: "fetcher || typeof fetch !== \"undefined\"",
|
|
291
307
|
|
|
@@ -303,23 +319,23 @@ const client = new ApolloClient({
|
|
|
303
319
|
`
|
|
304
320
|
},
|
|
305
321
|
|
|
306
|
-
|
|
322
|
+
56: {
|
|
307
323
|
file: "@apollo/client/__cjs/link/http/parseAndCheckHttpResponse.cjs",
|
|
308
324
|
condition: "response.body && typeof response.body.getReader === \"function\"",
|
|
309
325
|
message: "Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`."
|
|
310
326
|
},
|
|
311
327
|
|
|
312
|
-
|
|
328
|
+
57: {
|
|
313
329
|
file: "@apollo/client/__cjs/link/http/serializeFetchParameter.cjs",
|
|
314
330
|
message: `Network request failed. %s is not serializable: %s`
|
|
315
331
|
},
|
|
316
332
|
|
|
317
|
-
|
|
333
|
+
59: {
|
|
318
334
|
file: "@apollo/client/__cjs/link/core/ApolloLink.cjs",
|
|
319
335
|
message: "request is not implemented"
|
|
320
336
|
},
|
|
321
337
|
|
|
322
|
-
|
|
338
|
+
60: {
|
|
323
339
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
324
340
|
|
|
325
341
|
message: "To initialize Apollo Client, you must specify a 'cache' property " +
|
|
@@ -327,7 +343,7 @@ const client = new ApolloClient({
|
|
|
327
343
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
328
344
|
},
|
|
329
345
|
|
|
330
|
-
|
|
346
|
+
61: {
|
|
331
347
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
332
348
|
condition: "options.fetchPolicy !== \"cache-and-network\"",
|
|
333
349
|
|
|
@@ -337,130 +353,136 @@ const client = new ApolloClient({
|
|
|
337
353
|
"using a different fetchPolicy, such as cache-first or network-only."
|
|
338
354
|
},
|
|
339
355
|
|
|
340
|
-
|
|
356
|
+
62: {
|
|
357
|
+
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
358
|
+
condition: "options.query",
|
|
359
|
+
|
|
360
|
+
message: "query option is required. You must specify your GraphQL document " +
|
|
361
|
+
"in the query option."
|
|
362
|
+
},
|
|
363
|
+
|
|
364
|
+
63: {
|
|
365
|
+
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
366
|
+
condition: "options.query.kind === \"Document\"",
|
|
367
|
+
message: 'You must wrap the query string in a "gql" tag.'
|
|
368
|
+
},
|
|
369
|
+
|
|
370
|
+
64: {
|
|
371
|
+
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
372
|
+
condition: "!options.returnPartialData",
|
|
373
|
+
message: "returnPartialData option only supported on watchQuery."
|
|
374
|
+
},
|
|
375
|
+
|
|
376
|
+
65: {
|
|
377
|
+
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
378
|
+
condition: "!options.pollInterval",
|
|
379
|
+
message: "pollInterval option only supported on watchQuery."
|
|
380
|
+
},
|
|
381
|
+
|
|
382
|
+
67: {
|
|
341
383
|
file: "@apollo/client/__cjs/core/LocalState.cjs",
|
|
342
384
|
condition: "fragment",
|
|
343
385
|
message: `No fragment named %s`
|
|
344
386
|
},
|
|
345
387
|
|
|
346
|
-
|
|
388
|
+
68: {
|
|
347
389
|
file: "@apollo/client/__cjs/core/LocalState.cjs",
|
|
348
390
|
condition: "fragment",
|
|
349
391
|
message: `No fragment named %s`
|
|
350
392
|
},
|
|
351
393
|
|
|
352
|
-
|
|
394
|
+
70: {
|
|
353
395
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
354
396
|
condition: "updateQuery",
|
|
355
397
|
message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
|
|
356
398
|
},
|
|
357
399
|
|
|
358
|
-
|
|
400
|
+
72: {
|
|
359
401
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
360
402
|
condition: "pollInterval",
|
|
361
403
|
message: "Attempted to start a polling query without a polling interval."
|
|
362
404
|
},
|
|
363
405
|
|
|
364
|
-
|
|
406
|
+
74: {
|
|
365
407
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
366
408
|
message: "QueryManager stopped while query was in flight"
|
|
367
409
|
},
|
|
368
410
|
|
|
369
|
-
|
|
411
|
+
75: {
|
|
370
412
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
371
413
|
condition: "mutation",
|
|
372
414
|
message: "mutation option is required. You must specify your GraphQL document in the mutation option."
|
|
373
415
|
},
|
|
374
416
|
|
|
375
|
-
|
|
417
|
+
76: {
|
|
376
418
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
377
419
|
condition: "fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\"",
|
|
378
420
|
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."
|
|
379
421
|
},
|
|
380
422
|
|
|
381
|
-
|
|
382
|
-
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
383
|
-
condition: "options.query",
|
|
384
|
-
|
|
385
|
-
message: "query option is required. You must specify your GraphQL document " +
|
|
386
|
-
"in the query option."
|
|
387
|
-
},
|
|
388
|
-
|
|
389
|
-
72: {
|
|
390
|
-
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
391
|
-
condition: "options.query.kind === \"Document\"",
|
|
392
|
-
message: 'You must wrap the query string in a "gql" tag.'
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
73: {
|
|
396
|
-
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
397
|
-
condition: "!options.returnPartialData",
|
|
398
|
-
message: "returnPartialData option only supported on watchQuery."
|
|
399
|
-
},
|
|
400
|
-
|
|
401
|
-
74: {
|
|
423
|
+
77: {
|
|
402
424
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
403
|
-
|
|
404
|
-
message: "pollInterval option only supported on watchQuery."
|
|
425
|
+
message: "Store reset while query was in flight (not completed in link chain)"
|
|
405
426
|
},
|
|
406
427
|
|
|
407
|
-
|
|
428
|
+
81: {
|
|
408
429
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
409
|
-
|
|
430
|
+
condition: "didEmitValue",
|
|
431
|
+
message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
|
|
410
432
|
},
|
|
411
433
|
|
|
412
|
-
|
|
434
|
+
82: {
|
|
413
435
|
file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
|
|
414
436
|
condition: "typeof dataId === \"string\"",
|
|
415
437
|
message: "store.merge expects a string ID"
|
|
416
438
|
},
|
|
417
439
|
|
|
418
|
-
|
|
440
|
+
85: {
|
|
419
441
|
file: "@apollo/client/__cjs/cache/inmemory/key-extractor.cjs",
|
|
420
442
|
condition: "extracted !== void 0",
|
|
421
443
|
message: `Missing field '%s' while extracting keyFields from %s`
|
|
422
444
|
},
|
|
423
445
|
|
|
424
|
-
|
|
446
|
+
86: {
|
|
425
447
|
file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
|
|
426
448
|
condition: "!old || old === which",
|
|
427
449
|
message: `Cannot change root %s __typename more than once`
|
|
428
450
|
},
|
|
429
451
|
|
|
430
|
-
|
|
452
|
+
89: {
|
|
431
453
|
file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
|
|
432
454
|
message: "Cannot automatically merge arrays"
|
|
433
455
|
},
|
|
434
456
|
|
|
435
|
-
|
|
457
|
+
90: {
|
|
436
458
|
file: "@apollo/client/__cjs/cache/inmemory/readFromStore.cjs",
|
|
437
459
|
message: `No fragment named %s`
|
|
438
460
|
},
|
|
439
461
|
|
|
440
|
-
|
|
462
|
+
91: {
|
|
441
463
|
file: "@apollo/client/__cjs/cache/inmemory/readFromStore.cjs",
|
|
442
464
|
condition: "!(0, utilities_1.isReference)(value)",
|
|
443
465
|
message: `Missing selection set for object of type %s returned for query field %s`
|
|
444
466
|
},
|
|
445
467
|
|
|
446
|
-
|
|
468
|
+
92: {
|
|
447
469
|
file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
|
|
448
470
|
message: `Could not identify object %s`
|
|
449
471
|
},
|
|
450
472
|
|
|
451
|
-
|
|
473
|
+
94: {
|
|
452
474
|
file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
|
|
453
475
|
message: `No fragment named %s`
|
|
454
476
|
}
|
|
455
477
|
};
|
|
456
478
|
|
|
457
479
|
export const devDebug = {
|
|
458
|
-
|
|
480
|
+
66: {
|
|
459
481
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
460
482
|
message: `In client.refetchQueries, Promise.all promise rejected with error %o`
|
|
461
483
|
},
|
|
462
484
|
|
|
463
|
-
|
|
485
|
+
73: {
|
|
464
486
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
465
487
|
message: `Missing cache result fields: %o`
|
|
466
488
|
}
|
|
@@ -491,54 +513,54 @@ export const devWarn = {
|
|
|
491
513
|
"You may want to use the key parameter to specify a store key."
|
|
492
514
|
},
|
|
493
515
|
|
|
494
|
-
|
|
516
|
+
40: {
|
|
495
517
|
file: "@apollo/client/__cjs/react/hooks/useSuspenseQuery.cjs",
|
|
496
518
|
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."
|
|
497
519
|
},
|
|
498
520
|
|
|
499
|
-
|
|
521
|
+
46: {
|
|
500
522
|
file: "@apollo/client/__cjs/masking/maskDefinition.cjs",
|
|
501
523
|
message: "Accessing unmasked field on %s at path '%s'. This field will not be available when masking is enabled. Please read the field from the fragment instead."
|
|
502
524
|
},
|
|
503
525
|
|
|
504
|
-
|
|
526
|
+
50: {
|
|
505
527
|
file: "@apollo/client/__cjs/masking/utils.cjs",
|
|
506
528
|
message: "The configured cache does not support data masking which effectively disables it. Please use a cache that supports data masking or disable data masking to silence this warning."
|
|
507
529
|
},
|
|
508
530
|
|
|
509
|
-
|
|
531
|
+
55: {
|
|
510
532
|
file: "@apollo/client/__cjs/link/http/createHttpLink.cjs",
|
|
511
533
|
message: "Multipart-subscriptions do not support @defer"
|
|
512
534
|
},
|
|
513
535
|
|
|
514
|
-
|
|
536
|
+
58: {
|
|
515
537
|
file: "@apollo/client/__cjs/link/core/ApolloLink.cjs",
|
|
516
538
|
message: `You are calling concat on a terminating link, which will have no effect %o`
|
|
517
539
|
},
|
|
518
540
|
|
|
519
|
-
|
|
541
|
+
69: {
|
|
520
542
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
521
543
|
|
|
522
544
|
message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
|
|
523
545
|
Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
524
546
|
},
|
|
525
547
|
|
|
526
|
-
|
|
548
|
+
78: {
|
|
527
549
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
528
550
|
message: `Unknown query named "%s" requested in refetchQueries options.include array`
|
|
529
551
|
},
|
|
530
552
|
|
|
531
|
-
|
|
553
|
+
79: {
|
|
532
554
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
533
555
|
message: `Unknown anonymous query requested in refetchQueries options.include array`
|
|
534
556
|
},
|
|
535
557
|
|
|
536
|
-
|
|
558
|
+
80: {
|
|
537
559
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
538
560
|
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.'
|
|
539
561
|
},
|
|
540
562
|
|
|
541
|
-
|
|
563
|
+
83: {
|
|
542
564
|
file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
|
|
543
565
|
|
|
544
566
|
message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
|
|
@@ -546,24 +568,24 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
|
546
568
|
"`toReference(object, true)`"
|
|
547
569
|
},
|
|
548
570
|
|
|
549
|
-
|
|
571
|
+
84: {
|
|
550
572
|
file: "@apollo/client/__cjs/cache/inmemory/entityStore.cjs",
|
|
551
573
|
|
|
552
574
|
message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
|
|
553
575
|
"Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
|
|
554
576
|
},
|
|
555
577
|
|
|
556
|
-
|
|
578
|
+
87: {
|
|
557
579
|
file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
|
|
558
580
|
message: `Inferring subtype %s of supertype %s`
|
|
559
581
|
},
|
|
560
582
|
|
|
561
|
-
|
|
583
|
+
88: {
|
|
562
584
|
file: "@apollo/client/__cjs/cache/inmemory/policies.cjs",
|
|
563
585
|
message: `Undefined 'from' passed to readField with arguments %s`
|
|
564
586
|
},
|
|
565
587
|
|
|
566
|
-
|
|
588
|
+
95: {
|
|
567
589
|
file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
|
|
568
590
|
|
|
569
591
|
message: `Cache data may be lost when replacing the %s field of a %s object.
|
|
@@ -582,7 +604,7 @@ For more information about these options, please refer to the documentation:
|
|
|
582
604
|
`
|
|
583
605
|
},
|
|
584
606
|
|
|
585
|
-
|
|
607
|
+
96: {
|
|
586
608
|
file: "@apollo/client/__cjs/cache/core/cache.cjs",
|
|
587
609
|
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."
|
|
588
610
|
}
|
|
@@ -594,17 +616,17 @@ export const devError = {
|
|
|
594
616
|
message: `Could not find operation or fragment`
|
|
595
617
|
},
|
|
596
618
|
|
|
597
|
-
|
|
619
|
+
41: {
|
|
598
620
|
file: "@apollo/client/__cjs/react/hooks/useSyncExternalStore.cjs",
|
|
599
621
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
600
622
|
},
|
|
601
623
|
|
|
602
|
-
|
|
624
|
+
71: {
|
|
603
625
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
604
626
|
message: "Unhandled GraphQL subscription error"
|
|
605
627
|
},
|
|
606
628
|
|
|
607
|
-
|
|
629
|
+
93: {
|
|
608
630
|
file: "@apollo/client/__cjs/cache/inmemory/writeToStore.cjs",
|
|
609
631
|
message: `Missing field '%s' while writing result %o`
|
|
610
632
|
}
|
|
@@ -52,7 +52,7 @@ class ApolloLink {
|
|
|
52
52
|
static concat(first, second) {
|
|
53
53
|
const firstLink = toLink(first);
|
|
54
54
|
if (isTerminating(firstLink)) {
|
|
55
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
55
|
+
__DEV__ && invariant_1.invariant.warn(58, firstLink);
|
|
56
56
|
return firstLink;
|
|
57
57
|
}
|
|
58
58
|
const nextLink = toLink(second);
|
|
@@ -81,7 +81,7 @@ class ApolloLink {
|
|
|
81
81
|
return ApolloLink.concat(this, next);
|
|
82
82
|
}
|
|
83
83
|
request(operation, forward) {
|
|
84
|
-
throw (0, invariant_1.newInvariantError)(
|
|
84
|
+
throw (0, invariant_1.newInvariantError)(59);
|
|
85
85
|
}
|
|
86
86
|
onError(error, observer) {
|
|
87
87
|
if (observer && observer.error) {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.checkFetcher = void 0;
|
|
4
4
|
const invariant_1 = require("@apollo/client/utilities/invariant");
|
|
5
5
|
const checkFetcher = (fetcher) => {
|
|
6
|
-
(0, invariant_1.invariant)(fetcher || typeof fetch !== "undefined",
|
|
6
|
+
(0, invariant_1.invariant)(fetcher || typeof fetch !== "undefined", 54);
|
|
7
7
|
};
|
|
8
8
|
exports.checkFetcher = checkFetcher;
|
|
9
9
|
//# sourceMappingURL=checkFetcher.cjs.map
|
|
@@ -97,7 +97,7 @@ const createHttpLink = (linkOptions = {}) => {
|
|
|
97
97
|
// Omit defer-specific headers if the user attempts to defer a selection
|
|
98
98
|
// set on a subscription and log a warning.
|
|
99
99
|
if (isSubscription && hasDefer) {
|
|
100
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
100
|
+
__DEV__ && invariant_1.invariant.warn(55);
|
|
101
101
|
}
|
|
102
102
|
if (isSubscription) {
|
|
103
103
|
acceptHeader +=
|
|
@@ -27,7 +27,7 @@ async function readMultipartBody(response, nextValue) {
|
|
|
27
27
|
: "-";
|
|
28
28
|
const boundary = `\r\n--${boundaryVal}`;
|
|
29
29
|
let buffer = "";
|
|
30
|
-
(0, invariant_1.invariant)(response.body && typeof response.body.getReader === "function",
|
|
30
|
+
(0, invariant_1.invariant)(response.body && typeof response.body.getReader === "function", 56);
|
|
31
31
|
const iterator = response.body.getReader();
|
|
32
32
|
let running = true;
|
|
33
33
|
while (running) {
|
|
@@ -8,7 +8,7 @@ const serializeFetchParameter = (p, label) => {
|
|
|
8
8
|
serialized = JSON.stringify(p);
|
|
9
9
|
}
|
|
10
10
|
catch (e) {
|
|
11
|
-
const parseError = (0, invariant_1.newInvariantError)(
|
|
11
|
+
const parseError = (0, invariant_1.newInvariantError)(57, label, e.message);
|
|
12
12
|
parseError.parseError = e;
|
|
13
13
|
throw parseError;
|
|
14
14
|
}
|
|
@@ -46,7 +46,7 @@ const createPersistedQueryLink = (options) => {
|
|
|
46
46
|
// hashing with something other than SHA-256.
|
|
47
47
|
(0, invariant_1.invariant)(options &&
|
|
48
48
|
(typeof options.sha256 === "function" ||
|
|
49
|
-
typeof options.generateHash === "function"),
|
|
49
|
+
typeof options.generateHash === "function"), 52);
|
|
50
50
|
const { sha256,
|
|
51
51
|
// If both a `sha256` and `generateHash` option are provided, the
|
|
52
52
|
// `sha256` option will be ignored. Developers can configure and
|
|
@@ -72,7 +72,7 @@ const createPersistedQueryLink = (options) => {
|
|
|
72
72
|
return hash;
|
|
73
73
|
}
|
|
74
74
|
return Object.assign(new core_1.ApolloLink((operation, forward) => {
|
|
75
|
-
(0, invariant_1.invariant)(forward,
|
|
75
|
+
(0, invariant_1.invariant)(forward, 53);
|
|
76
76
|
const { query } = operation;
|
|
77
77
|
return new rxjs_1.Observable((observer) => {
|
|
78
78
|
let subscription;
|
|
@@ -64,7 +64,9 @@ class GraphQLWsLink extends core_1.ApolloLink {
|
|
|
64
64
|
// reason will be available on clean closes
|
|
65
65
|
new Error(`Socket closed${likeClose ? ` with event ${err.code}` : ""}${likeClose ? ` ${err.reason}` : ""}`));
|
|
66
66
|
}
|
|
67
|
-
return observer.error(new errors_1.CombinedGraphQLErrors(
|
|
67
|
+
return observer.error(new errors_1.CombinedGraphQLErrors({
|
|
68
|
+
errors: Array.isArray(err) ? err : [err],
|
|
69
|
+
}));
|
|
68
70
|
},
|
|
69
71
|
// casting around a wrong type in graphql-ws, which incorrectly expects `Sink<ExecutionResult>`
|
|
70
72
|
});
|