UNPKG

12.9 kBJavaScriptView Raw
1// This file is meant to help with looking up the source of errors like
2// "Invariant Violation: 35" and is automatically generated by the file
3// @apollo/client/config/processInvariants.ts for each @apollo/client
4// release. The numbers may change from release to release, so please
5// consult the @apollo/client/invariantErrorCodes.js file specific to
6// your @apollo/client version. This file is not meant to be imported.
7{
8 "@apollo/client version": "3.7.15",
9
10 1: {
11 file: "@apollo/client/cache/inmemory/entityStore.js",
12 node: invariant(typeof dataId === "string", "store.merge expects a string ID")
13 },
14
15 2: {
16 file: "@apollo/client/cache/inmemory/key-extractor.js",
17 node: invariant(extracted !== void 0, "Missing field '".concat(schemaKeyPath.join('.'), "' while extracting keyFields from ").concat(JSON.stringify(object)))
18 },
19
20 3: {
21 file: "@apollo/client/cache/inmemory/policies.js",
22 node: invariant(!old || old === which, "Cannot change root ".concat(which, " __typename more than once"))
23 },
24
25 4: {
26 file: "@apollo/client/cache/inmemory/policies.js",
27 node: new InvariantError("Cannot automatically merge arrays")
28 },
29
30 5: {
31 file: "@apollo/client/cache/inmemory/readFromStore.js",
32 node: new InvariantError("No fragment named ".concat(selection.name.value))
33 },
34
35 6: {
36 file: "@apollo/client/cache/inmemory/readFromStore.js",
37 node: invariant(!isReference(value), "Missing selection set for object of type ".concat(getTypenameFromStoreObject(store, value), " returned for query field ").concat(field.name.value))
38 },
39
40 7: {
41 file: "@apollo/client/cache/inmemory/writeToStore.js",
42 node: new InvariantError("Could not identify object ".concat(JSON.stringify(result)))
43 },
44
45 8: {
46 file: "@apollo/client/cache/inmemory/writeToStore.js",
47 node: new InvariantError("No fragment named ".concat(selection.name.value))
48 },
49
50 9: {
51 file: "@apollo/client/core/ApolloClient.js",
52
53 node: new InvariantError("To initialize Apollo Client, you must specify a 'cache' property " +
54 "in the options object. \n" +
55 "For more information, please visit: https://go.apollo.dev/c/docs")
56 },
57
58 10: {
59 file: "@apollo/client/core/ApolloClient.js",
60
61 node: invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' +
62 'client.query can only return a single result. Please use client.watchQuery ' +
63 'to receive multiple results from the cache and the network, or consider ' +
64 'using a different fetchPolicy, such as cache-first or network-only.')
65 },
66
67 11: {
68 file: "@apollo/client/core/LocalState.js",
69 node: invariant(fragment, "No fragment named ".concat(selection.name.value))
70 },
71
72 12: {
73 file: "@apollo/client/core/LocalState.js",
74 node: invariant(fragment, "No fragment named ".concat(spread.name.value))
75 },
76
77 13: {
78 file: "@apollo/client/core/ObservableQuery.js",
79 node: invariant(pollInterval, 'Attempted to start a polling query without a polling interval.')
80 },
81
82 14: {
83 file: "@apollo/client/core/QueryManager.js",
84 node: new InvariantError('QueryManager stopped while query was in flight')
85 },
86
87 15: {
88 file: "@apollo/client/core/QueryManager.js",
89 node: invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.')
90 },
91
92 16: {
93 file: "@apollo/client/core/QueryManager.js",
94
95 node: invariant(fetchPolicy === 'network-only' ||
96 fetchPolicy === 'no-cache', "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.")
97 },
98
99 17: {
100 file: "@apollo/client/core/QueryManager.js",
101
102 node: invariant(options.query, 'query option is required. You must specify your GraphQL document ' +
103 'in the query option.')
104 },
105
106 18: {
107 file: "@apollo/client/core/QueryManager.js",
108 node: invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.')
109 },
110
111 19: {
112 file: "@apollo/client/core/QueryManager.js",
113 node: invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.')
114 },
115
116 20: {
117 file: "@apollo/client/core/QueryManager.js",
118 node: invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.')
119 },
120
121 21: {
122 file: "@apollo/client/core/QueryManager.js",
123 node: new InvariantError('Store reset while query was in flight (not completed in link chain)')
124 },
125
126 22: {
127 file: "@apollo/client/link/core/ApolloLink.js",
128 node: new InvariantError('request is not implemented')
129 },
130
131 23: {
132 file: "@apollo/client/link/http/checkFetcher.js",
133 node: new InvariantError("\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 ")
134 },
135
136 24: {
137 file: "@apollo/client/link/http/serializeFetchParameter.js",
138 node: new InvariantError("Network request failed. ".concat(label, " is not serializable: ").concat(e.message))
139 },
140
141 25: {
142 file: "@apollo/client/link/persisted-queries/index.js",
143
144 node: invariant(options && (typeof options.sha256 === 'function' ||
145 typeof options.generateHash === 'function'), 'Missing/invalid "sha256" or "generateHash" function. Please ' +
146 'configure one using the "createPersistedQueryLink(options)" options ' +
147 'parameter.')
148 },
149
150 26: {
151 file: "@apollo/client/link/persisted-queries/index.js",
152 node: invariant(forward, 'PersistedQueryLink cannot be the last link in the chain.')
153 },
154
155 27: {
156 file: "@apollo/client/link/utils/validateOperation.js",
157 node: new InvariantError("illegal argument: ".concat(key))
158 },
159
160 28: {
161 file: "@apollo/client/react/context/ApolloConsumer.js",
162
163 node: invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
164 'Wrap the root component in an <ApolloProvider>.')
165 },
166
167 29: {
168 file: "@apollo/client/react/context/ApolloProvider.js",
169
170 node: invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
171 'sure you pass in your client via the "client" prop.')
172 },
173
174 30: {
175 file: "@apollo/client/react/hoc/hoc-utils.js",
176
177 node: invariant(this.withRef, "To access the wrapped instance, you need to specify " +
178 "{ withRef: true } in the options")
179 },
180
181 31: {
182 file: "@apollo/client/react/hoc/withApollo.js",
183
184 node: invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " +
185 "{ withRef: true } in the options")
186 },
187
188 32: {
189 file: "@apollo/client/react/hooks/useApolloClient.js",
190
191 node: invariant(!!client, 'Could not find "client" in the context or passed in as an option. ' +
192 'Wrap the root component in an <ApolloProvider>, or pass an ApolloClient ' +
193 'instance in via options.')
194 },
195
196 33: {
197 file: "@apollo/client/react/parser/index.js",
198
199 node: invariant(!!document && !!document.kind, "Argument of ".concat(document, " passed to parser was not a valid GraphQL ") +
200 "DocumentNode. You may need to use 'graphql-tag' or another method " +
201 "to convert your operation into a document")
202 },
203
204 34: {
205 file: "@apollo/client/react/parser/index.js",
206
207 node: invariant(!fragments.length ||
208 (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " +
209 "You must include a query, subscription or mutation as well")
210 },
211
212 35: {
213 file: "@apollo/client/react/parser/index.js",
214
215 node: invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " +
216 "".concat(document, " had ").concat(queries.length, " queries, ").concat(subscriptions.length, " ") +
217 "subscriptions and ".concat(mutations.length, " mutations. ") +
218 "You can use 'compose' to join multiple operation types to a component")
219 },
220
221 36: {
222 file: "@apollo/client/react/parser/index.js",
223
224 node: invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. ".concat(document, " had ") +
225 "".concat(definitions.length, " definitions. ") +
226 "You can use 'compose' to join multiple operation types to a component")
227 },
228
229 37: {
230 file: "@apollo/client/react/parser/index.js",
231
232 node: invariant(operation.type === type, "Running a ".concat(requiredOperationName, " requires a graphql ") +
233 "".concat(requiredOperationName, ", but a ").concat(usedOperationName, " was used instead."))
234 },
235
236 38: {
237 file: "@apollo/client/testing/core/mocking/mockLink.js",
238 node: invariant(queryWithoutConnection, "query is required")
239 },
240
241 39: {
242 file: "@apollo/client/utilities/globals/index.js",
243 node: invariant("boolean" === typeof DEV, DEV)
244 },
245
246 40: {
247 file: "@apollo/client/utilities/graphql/directives.js",
248 node: invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive."))
249 },
250
251 41: {
252 file: "@apollo/client/utilities/graphql/directives.js",
253 node: invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive."))
254 },
255
256 42: {
257 file: "@apollo/client/utilities/graphql/directives.js",
258 node: invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive."))
259 },
260
261 43: {
262 file: "@apollo/client/utilities/graphql/directives.js",
263
264 node: invariant(ifValue &&
265 (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @".concat(directiveName, " directive must be a variable or a boolean value."))
266 },
267
268 44: {
269 file: "@apollo/client/utilities/graphql/fragments.js",
270
271 node: new InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
272 'No operations are allowed when using a fragment as a query. Only fragments are allowed.')
273 },
274
275 45: {
276 file: "@apollo/client/utilities/graphql/fragments.js",
277 node: invariant(fragments.length === 1, "Found ".concat(fragments.length, " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."))
278 },
279
280 46: {
281 file: "@apollo/client/utilities/graphql/fragments.js",
282 node: invariant(fragment, "No fragment named ".concat(fragmentName))
283 },
284
285 47: {
286 file: "@apollo/client/utilities/graphql/getFromAST.js",
287 node: invariant(doc && doc.kind === 'Document', "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")
288 },
289
290 48: {
291 file: "@apollo/client/utilities/graphql/getFromAST.js",
292 node: new InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\""))
293 },
294
295 49: {
296 file: "@apollo/client/utilities/graphql/getFromAST.js",
297 node: invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations"))
298 },
299
300 50: {
301 file: "@apollo/client/utilities/graphql/getFromAST.js",
302 node: invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.')
303 },
304
305 51: {
306 file: "@apollo/client/utilities/graphql/getFromAST.js",
307 node: invariant(doc.kind === 'Document', "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")
308 },
309
310 52: {
311 file: "@apollo/client/utilities/graphql/getFromAST.js",
312 node: invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.')
313 },
314
315 53: {
316 file: "@apollo/client/utilities/graphql/getFromAST.js",
317 node: invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.')
318 },
319
320 54: {
321 file: "@apollo/client/utilities/graphql/getFromAST.js",
322 node: new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.')
323 },
324
325 55: {
326 file: "@apollo/client/utilities/graphql/storeUtils.js",
327
328 node: new InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
329 'is not supported. Use variables instead of inline arguments to ' +
330 'overcome this limitation.')
331 }
332}