UNPKG

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