UNPKG

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