@apollo/client 3.14.0-alpha.0 → 3.14.0-alpha.1
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/breezy-lions-rule.md +5 -0
- package/.changeset/great-jobs-fetch.md +5 -0
- package/.changeset/pre.json +4 -1
- package/.changeset/tidy-bulldogs-exercise.md +5 -0
- package/CHANGELOG.md +10 -0
- package/apollo-client.cjs +187 -119
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +7 -2
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +7 -2
- package/cache/inmemory/inMemoryCache.d.ts +8 -0
- package/cache/inmemory/inMemoryCache.js +3 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/core/ApolloClient.d.ts +9 -9
- package/core/ApolloClient.js +6 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.d.ts +51 -6
- package/core/ObservableQuery.js +89 -13
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.js +6 -3
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +14 -12
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +85 -33
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +85 -33
- package/core/types.d.ts +177 -3
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +10 -2
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +149 -97
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +149 -97
- package/errors/errors.cjs.map +1 -1
- package/errors/index.d.ts +19 -0
- package/errors/index.js +19 -0
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.js +161 -96
- package/link/batch-http/batch-http.cjs +9 -0
- package/link/batch-http/batch-http.cjs.map +1 -1
- package/link/batch-http/batch-http.cjs.native.js +9 -0
- package/link/batch-http/batchHttpLink.js +9 -0
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/core/ApolloLink.d.ts +8 -0
- package/link/core/ApolloLink.js +19 -2
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/core.cjs +24 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +24 -2
- package/link/core/types.d.ts +20 -0
- package/link/core/types.js.map +1 -1
- package/link/error/index.d.ts +48 -0
- package/link/error/index.js.map +1 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +4 -1
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/http.cjs +6 -3
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +6 -3
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.d.ts +38 -0
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/index.js.map +1 -1
- 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/fromError.d.ts +16 -0
- package/link/utils/fromError.js +16 -0
- package/link/utils/fromError.js.map +1 -1
- package/link/utils/fromPromise.d.ts +16 -0
- package/link/utils/fromPromise.js +16 -0
- package/link/utils/fromPromise.js.map +1 -1
- package/link/utils/throwServerError.d.ts +30 -0
- package/link/utils/throwServerError.js +17 -0
- package/link/utils/throwServerError.js.map +1 -1
- package/link/utils/toPromise.d.ts +16 -0
- package/link/utils/toPromise.js +17 -1
- package/link/utils/toPromise.js.map +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/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/masking.cjs +6 -6
- package/masking/masking.cjs.map +1 -1
- package/masking/masking.cjs.native.js +6 -6
- package/masking/utils.js +1 -1
- package/masking/utils.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Mutation.js +1 -1
- package/react/components/Query.js +1 -1
- package/react/components/Subscription.js +1 -1
- package/react/components/components.cjs +6 -4
- package/react/components/components.cjs.map +1 -1
- package/react/components/components.cjs.native.js +6 -4
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +2 -2
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +4 -4
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +4 -4
- package/react/hoc/graphql.js +1 -1
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +9 -7
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +9 -7
- package/react/hoc/mutation-hoc.js +1 -1
- package/react/hoc/query-hoc.js +1 -1
- package/react/hoc/subscription-hoc.js +1 -1
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +18 -16
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +18 -16
- package/react/hooks/internal/useWarnRemoved.d.ts +2 -1
- package/react/hooks/internal/useWarnRemoved.js.map +1 -1
- package/react/hooks/internal/useWarnRemovedOption.js +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useLazyQuery.js +2 -2
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useQuery.js +1 -1
- package/react/hooks/useSubscription.js +3 -3
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.d.ts +1 -0
- package/react/internal/cache/QueryReference.js +5 -2
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/internal.cjs +16 -3
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +16 -3
- package/react/parser/index.js +6 -6
- package/react/parser/parser.cjs +9 -7
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +9 -7
- package/react/react.cjs +4 -2
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +4 -2
- package/react/types/types.d.ts +40 -0
- package/react/types/types.documentation.d.ts +1 -1
- package/react/types/types.documentation.js.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +17 -3
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +17 -3
- package/testing/core/itAsync.d.ts +5 -0
- package/testing/core/itAsync.js +5 -0
- package/testing/core/itAsync.js.map +1 -1
- package/testing/core/mocking/mockClient.d.ts +4 -0
- package/testing/core/mocking/mockClient.js +4 -0
- package/testing/core/mocking/mockClient.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +10 -0
- package/testing/core/mocking/mockLink.js +23 -4
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts +4 -0
- package/testing/core/mocking/mockSubscriptionLink.js +4 -0
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
- package/testing/core/subscribeAndCount.d.ts +4 -0
- package/testing/core/subscribeAndCount.js +4 -0
- package/testing/core/subscribeAndCount.js.map +1 -1
- package/testing/experimental/createSchemaFetch.d.ts +1 -1
- package/testing/experimental/createSchemaFetch.js +1 -1
- package/testing/experimental/createSchemaFetch.js.map +1 -1
- package/testing/experimental/createTestSchema.d.ts +1 -1
- package/testing/experimental/createTestSchema.js +1 -1
- package/testing/experimental/createTestSchema.js.map +1 -1
- package/testing/experimental/experimental.cjs.map +1 -1
- package/testing/testing.cjs +4 -2
- package/testing/testing.cjs.map +1 -1
- package/testing/testing.cjs.native.js +4 -2
- package/utilities/deprecation/index.d.ts +83 -3
- package/utilities/deprecation/index.js +15 -3
- package/utilities/deprecation/index.js.map +1 -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 +7 -7
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/observables/asyncMap.d.ts +13 -0
- package/utilities/observables/asyncMap.js +13 -0
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/observables/iteration.d.ts +4 -0
- package/utilities/observables/iteration.js +4 -0
- package/utilities/observables/iteration.js.map +1 -1
- package/utilities/subscriptions/urql/index.d.ts +5 -0
- package/utilities/subscriptions/urql/index.js +5 -0
- package/utilities/subscriptions/urql/index.js.map +1 -1
- package/utilities/subscriptions/urql/urql.cjs.map +1 -1
- package/utilities/utilities.cjs +22 -22
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +22 -22
- package/version.js +1 -1
package/dev/dev.cjs
CHANGED
|
@@ -57,120 +57,120 @@ const errorCodes =
|
|
|
57
57
|
"to receive multiple results from the cache and the network, or consider " +
|
|
58
58
|
"using a different fetchPolicy, such as cache-first or network-only."
|
|
59
59
|
},
|
|
60
|
-
|
|
60
|
+
21: {
|
|
61
61
|
file: "@apollo/client/core/LocalState.js",
|
|
62
62
|
condition: "fragment",
|
|
63
63
|
message: "No fragment named %s"
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
22: {
|
|
66
66
|
file: "@apollo/client/core/LocalState.js",
|
|
67
67
|
condition: "fragment",
|
|
68
68
|
message: "No fragment named %s"
|
|
69
69
|
},
|
|
70
|
-
|
|
70
|
+
29: {
|
|
71
71
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
72
72
|
condition: "updateQuery",
|
|
73
73
|
message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
32: {
|
|
76
76
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
77
77
|
condition: "pollInterval",
|
|
78
78
|
message: "Attempted to start a polling query without a polling interval."
|
|
79
79
|
},
|
|
80
|
-
|
|
80
|
+
35: {
|
|
81
81
|
file: "@apollo/client/core/QueryManager.js",
|
|
82
82
|
message: "QueryManager stopped while query was in flight"
|
|
83
83
|
},
|
|
84
|
-
|
|
84
|
+
36: {
|
|
85
85
|
file: "@apollo/client/core/QueryManager.js",
|
|
86
86
|
condition: "mutation",
|
|
87
87
|
message: "mutation option is required. You must specify your GraphQL document in the mutation option."
|
|
88
88
|
},
|
|
89
|
-
|
|
89
|
+
37: {
|
|
90
90
|
file: "@apollo/client/core/QueryManager.js",
|
|
91
91
|
condition: "fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\"",
|
|
92
92
|
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."
|
|
93
93
|
},
|
|
94
|
-
|
|
94
|
+
38: {
|
|
95
95
|
file: "@apollo/client/core/QueryManager.js",
|
|
96
96
|
condition: "options.query",
|
|
97
97
|
message: "query option is required. You must specify your GraphQL document " +
|
|
98
98
|
"in the query option."
|
|
99
99
|
},
|
|
100
|
-
|
|
100
|
+
39: {
|
|
101
101
|
file: "@apollo/client/core/QueryManager.js",
|
|
102
102
|
condition: "options.query.kind === \"Document\"",
|
|
103
103
|
message: 'You must wrap the query string in a "gql" tag.'
|
|
104
104
|
},
|
|
105
|
-
|
|
105
|
+
40: {
|
|
106
106
|
file: "@apollo/client/core/QueryManager.js",
|
|
107
107
|
condition: "!options.returnPartialData",
|
|
108
108
|
message: "returnPartialData option only supported on watchQuery."
|
|
109
109
|
},
|
|
110
|
-
|
|
110
|
+
41: {
|
|
111
111
|
file: "@apollo/client/core/QueryManager.js",
|
|
112
112
|
condition: "!options.pollInterval",
|
|
113
113
|
message: "pollInterval option only supported on watchQuery."
|
|
114
114
|
},
|
|
115
|
-
|
|
115
|
+
42: {
|
|
116
116
|
file: "@apollo/client/core/QueryManager.js",
|
|
117
117
|
message: "Store reset while query was in flight (not completed in link chain)"
|
|
118
118
|
},
|
|
119
|
-
|
|
119
|
+
48: {
|
|
120
120
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
121
121
|
message: "request is not implemented"
|
|
122
122
|
},
|
|
123
|
-
|
|
123
|
+
51: {
|
|
124
124
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
125
125
|
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 "
|
|
126
126
|
},
|
|
127
|
-
|
|
127
|
+
54: {
|
|
128
128
|
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
129
129
|
message: "Network request failed. %s is not serializable: %s"
|
|
130
130
|
},
|
|
131
|
-
|
|
131
|
+
55: {
|
|
132
132
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
133
133
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
134
134
|
message: 'Missing/invalid "sha256" or "generateHash" function. Please ' +
|
|
135
135
|
'configure one using the "createPersistedQueryLink(options)" options ' +
|
|
136
136
|
"parameter."
|
|
137
137
|
},
|
|
138
|
-
|
|
138
|
+
56: {
|
|
139
139
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
140
140
|
condition: "forward",
|
|
141
141
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
142
142
|
},
|
|
143
|
-
|
|
143
|
+
58: {
|
|
144
144
|
file: "@apollo/client/link/utils/validateOperation.js",
|
|
145
145
|
message: "illegal argument: %s"
|
|
146
146
|
},
|
|
147
|
-
|
|
147
|
+
59: {
|
|
148
148
|
file: "@apollo/client/masking/maskDefinition.js",
|
|
149
149
|
condition: "fragment",
|
|
150
150
|
message: "Could not find fragment with name '%s'."
|
|
151
151
|
},
|
|
152
|
-
|
|
152
|
+
61: {
|
|
153
153
|
file: "@apollo/client/masking/maskFragment.js",
|
|
154
154
|
condition: "fragments.length === 1",
|
|
155
155
|
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
156
156
|
},
|
|
157
|
-
|
|
157
|
+
62: {
|
|
158
158
|
file: "@apollo/client/masking/maskFragment.js",
|
|
159
159
|
condition: "!!fragment",
|
|
160
160
|
message: "Could not find fragment with name \"%s\"."
|
|
161
161
|
},
|
|
162
|
-
|
|
162
|
+
63: {
|
|
163
163
|
file: "@apollo/client/masking/maskOperation.js",
|
|
164
164
|
condition: "definition",
|
|
165
165
|
message: "Expected a parsed GraphQL document with a query, mutation, or subscription."
|
|
166
166
|
},
|
|
167
|
-
|
|
167
|
+
68: {
|
|
168
168
|
file: "@apollo/client/react/context/ApolloConsumer.js",
|
|
169
169
|
condition: "context && context.client",
|
|
170
170
|
message: 'Could not find "client" in the context of ApolloConsumer. ' +
|
|
171
171
|
"Wrap the root component in an <ApolloProvider>."
|
|
172
172
|
},
|
|
173
|
-
|
|
173
|
+
69: {
|
|
174
174
|
file: "@apollo/client/react/context/ApolloContext.js",
|
|
175
175
|
condition: "\"createContext\" in React",
|
|
176
176
|
message: "Invoking `getApolloContext` in an environment where `React.createContext` is not available.\n" +
|
|
@@ -178,70 +178,70 @@ const errorCodes =
|
|
|
178
178
|
'Please make sure to add "use client" at the top of your file.\n' +
|
|
179
179
|
"For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
|
|
180
180
|
},
|
|
181
|
-
|
|
181
|
+
71: {
|
|
182
182
|
file: "@apollo/client/react/context/ApolloProvider.js",
|
|
183
183
|
condition: "context.client",
|
|
184
184
|
message: "ApolloProvider was not passed a client instance. Make " +
|
|
185
185
|
'sure you pass in your client via the "client" prop.'
|
|
186
186
|
},
|
|
187
|
-
|
|
187
|
+
73: {
|
|
188
188
|
file: "@apollo/client/react/hoc/hoc-utils.js",
|
|
189
189
|
condition: "this.withRef",
|
|
190
190
|
message: "To access the wrapped instance, you need to specify " +
|
|
191
191
|
"{ withRef: true } in the options"
|
|
192
192
|
},
|
|
193
|
-
|
|
193
|
+
77: {
|
|
194
194
|
file: "@apollo/client/react/hoc/withApollo.js",
|
|
195
195
|
condition: "operationOptions.withRef",
|
|
196
196
|
message: "To access the wrapped instance, you need to specify " +
|
|
197
197
|
"{ withRef: true } in the options"
|
|
198
198
|
},
|
|
199
|
-
|
|
199
|
+
79: {
|
|
200
200
|
file: "@apollo/client/react/hooks/useApolloClient.js",
|
|
201
201
|
condition: "!!client",
|
|
202
202
|
message: 'Could not find "client" in the context or passed in as an option. ' +
|
|
203
203
|
"Wrap the root component in an <ApolloProvider>, or pass an ApolloClient " +
|
|
204
204
|
"instance in via options."
|
|
205
205
|
},
|
|
206
|
-
|
|
206
|
+
82: {
|
|
207
207
|
file: "@apollo/client/react/hooks/useLoadableQuery.js",
|
|
208
208
|
condition: "!calledDuringRender()",
|
|
209
209
|
message: "useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook."
|
|
210
210
|
},
|
|
211
|
-
|
|
211
|
+
83: {
|
|
212
212
|
file: "@apollo/client/react/hooks/useLoadableQuery.js",
|
|
213
213
|
condition: "internalQueryRef",
|
|
214
214
|
message: "The query has not been loaded. Please load the query."
|
|
215
215
|
},
|
|
216
|
-
|
|
216
|
+
89: {
|
|
217
217
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
218
218
|
condition: "!optionsRef.current.skip",
|
|
219
219
|
message: "A subscription that is skipped cannot be restarted."
|
|
220
220
|
},
|
|
221
|
-
|
|
221
|
+
90: {
|
|
222
222
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
223
223
|
condition: "supportedFetchPolicies.includes(fetchPolicy)",
|
|
224
224
|
message: "The fetch policy `%s` is not supported with suspense."
|
|
225
225
|
},
|
|
226
|
-
|
|
226
|
+
93: {
|
|
227
227
|
file: "@apollo/client/react/internal/cache/QueryReference.js",
|
|
228
228
|
condition: "!queryRef || QUERY_REFERENCE_SYMBOL in queryRef",
|
|
229
229
|
message: "Expected a QueryRef object, but got something else instead."
|
|
230
230
|
},
|
|
231
|
-
|
|
231
|
+
95: {
|
|
232
232
|
file: "@apollo/client/react/parser/index.js",
|
|
233
233
|
condition: "!!document && !!document.kind",
|
|
234
234
|
message: "Argument of %s passed to parser was not a valid GraphQL " +
|
|
235
235
|
"DocumentNode. You may need to use 'graphql-tag' or another method " +
|
|
236
236
|
"to convert your operation into a document"
|
|
237
237
|
},
|
|
238
|
-
|
|
238
|
+
96: {
|
|
239
239
|
file: "@apollo/client/react/parser/index.js",
|
|
240
240
|
condition: "!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length",
|
|
241
241
|
message: "Passing only a fragment to 'graphql' is not yet supported. " +
|
|
242
242
|
"You must include a query, subscription or mutation as well"
|
|
243
243
|
},
|
|
244
|
-
|
|
244
|
+
97: {
|
|
245
245
|
file: "@apollo/client/react/parser/index.js",
|
|
246
246
|
condition: "queries.length + mutations.length + subscriptions.length <= 1",
|
|
247
247
|
message: "react-apollo only supports a query, subscription, or a mutation per HOC. " +
|
|
@@ -249,107 +249,107 @@ const errorCodes =
|
|
|
249
249
|
"subscriptions and %s mutations. " +
|
|
250
250
|
"You can use 'compose' to join multiple operation types to a component"
|
|
251
251
|
},
|
|
252
|
-
|
|
252
|
+
98: {
|
|
253
253
|
file: "@apollo/client/react/parser/index.js",
|
|
254
254
|
condition: "definitions.length === 1",
|
|
255
255
|
message: "react-apollo only supports one definition per HOC. %s had " +
|
|
256
256
|
"%s definitions. " +
|
|
257
257
|
"You can use 'compose' to join multiple operation types to a component"
|
|
258
258
|
},
|
|
259
|
-
|
|
259
|
+
99: {
|
|
260
260
|
file: "@apollo/client/react/parser/index.js",
|
|
261
261
|
condition: "operation.type === type",
|
|
262
262
|
message: "Running a %s requires a graphql " + "%s, but a %s was used instead."
|
|
263
263
|
},
|
|
264
|
-
|
|
264
|
+
102: {
|
|
265
265
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
266
266
|
condition: "queryWithoutClientOnlyDirectives",
|
|
267
267
|
message: "query is required"
|
|
268
268
|
},
|
|
269
|
-
|
|
269
|
+
103: {
|
|
270
270
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
271
271
|
condition: "mockedResponse.maxUsageCount > 0",
|
|
272
272
|
message: "Mock response maxUsageCount must be greater than 0, %s given"
|
|
273
273
|
},
|
|
274
|
-
|
|
274
|
+
105: {
|
|
275
275
|
file: "@apollo/client/utilities/graphql/DocumentTransform.js",
|
|
276
276
|
condition: "Array.isArray(cacheKeys)",
|
|
277
277
|
message: "`getCacheKey` must return an array or undefined"
|
|
278
278
|
},
|
|
279
|
-
|
|
279
|
+
106: {
|
|
280
280
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
281
281
|
condition: "evaledValue !== void 0",
|
|
282
282
|
message: "Invalid variable referenced in @%s directive."
|
|
283
283
|
},
|
|
284
|
-
|
|
284
|
+
107: {
|
|
285
285
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
286
286
|
condition: "directiveArguments && directiveArguments.length === 1",
|
|
287
287
|
message: "Incorrect number of arguments for the @%s directive."
|
|
288
288
|
},
|
|
289
|
-
|
|
289
|
+
108: {
|
|
290
290
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
291
291
|
condition: "ifArgument.name && ifArgument.name.value === \"if\"",
|
|
292
292
|
message: "Invalid argument for the @%s directive."
|
|
293
293
|
},
|
|
294
|
-
|
|
294
|
+
109: {
|
|
295
295
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
296
296
|
condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
|
|
297
297
|
message: "Argument for the @%s directive must be a variable or a boolean value."
|
|
298
298
|
},
|
|
299
|
-
|
|
299
|
+
113: {
|
|
300
300
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
301
301
|
message: "Found a %s operation%s. " +
|
|
302
302
|
"No operations are allowed when using a fragment as a query. Only fragments are allowed."
|
|
303
303
|
},
|
|
304
|
-
|
|
304
|
+
114: {
|
|
305
305
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
306
306
|
condition: "fragments.length === 1",
|
|
307
307
|
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
308
308
|
},
|
|
309
|
-
|
|
309
|
+
115: {
|
|
310
310
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
311
311
|
condition: "fragment",
|
|
312
312
|
message: "No fragment named %s"
|
|
313
313
|
},
|
|
314
|
-
|
|
314
|
+
116: {
|
|
315
315
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
316
316
|
condition: "doc && doc.kind === \"Document\"",
|
|
317
317
|
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"
|
|
318
318
|
},
|
|
319
|
-
|
|
319
|
+
117: {
|
|
320
320
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
321
321
|
message: "Schema type definitions not allowed in queries. Found: \"%s\""
|
|
322
322
|
},
|
|
323
|
-
|
|
323
|
+
118: {
|
|
324
324
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
325
325
|
condition: "operations.length <= 1",
|
|
326
326
|
message: "Ambiguous GraphQL document: contains %s operations"
|
|
327
327
|
},
|
|
328
|
-
|
|
328
|
+
119: {
|
|
329
329
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
330
330
|
condition: "queryDef && queryDef.operation === \"query\"",
|
|
331
331
|
message: "Must contain a query definition."
|
|
332
332
|
},
|
|
333
|
-
|
|
333
|
+
120: {
|
|
334
334
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
335
335
|
condition: "doc.kind === \"Document\"",
|
|
336
336
|
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"
|
|
337
337
|
},
|
|
338
|
-
|
|
338
|
+
121: {
|
|
339
339
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
340
340
|
condition: "doc.definitions.length <= 1",
|
|
341
341
|
message: "Fragment must have exactly one definition."
|
|
342
342
|
},
|
|
343
|
-
|
|
343
|
+
122: {
|
|
344
344
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
345
345
|
condition: "fragmentDef.kind === \"FragmentDefinition\"",
|
|
346
346
|
message: "Must be a fragment definition."
|
|
347
347
|
},
|
|
348
|
-
|
|
348
|
+
123: {
|
|
349
349
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
350
350
|
message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
|
|
351
351
|
},
|
|
352
|
-
|
|
352
|
+
124: {
|
|
353
353
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
354
354
|
message: "The inline argument \"%s\" of kind \"%s\"" +
|
|
355
355
|
"is not supported. Use variables instead of inline arguments to " +
|
|
@@ -357,11 +357,11 @@ const errorCodes =
|
|
|
357
357
|
}
|
|
358
358
|
};
|
|
359
359
|
const devDebug = {
|
|
360
|
-
|
|
360
|
+
20: {
|
|
361
361
|
file: "@apollo/client/core/ApolloClient.js",
|
|
362
362
|
message: "In client.refetchQueries, Promise.all promise rejected with error %o"
|
|
363
363
|
},
|
|
364
|
-
|
|
364
|
+
34: {
|
|
365
365
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
366
366
|
message: "Missing cache result fields: %o"
|
|
367
367
|
}
|
|
@@ -399,131 +399,183 @@ const devWarn = {
|
|
|
399
399
|
file: "@apollo/client/core/ApolloClient.js",
|
|
400
400
|
message: "[ApolloClient]: Apollo Client 4.0 will require a `link` option and will not create a default link when not provided. Please provide a `link` option."
|
|
401
401
|
},
|
|
402
|
-
|
|
402
|
+
19: {
|
|
403
|
+
file: "@apollo/client/core/ApolloClient.js",
|
|
404
|
+
message: "[client.query]: Apollo Client 4.0 will no longer support the `standby` fetch policy with `client.query`. Please use a different fetch policy."
|
|
405
|
+
},
|
|
406
|
+
23: {
|
|
407
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
408
|
+
message: "[observableQuery.result]: `result` is deprecated and will be removed with Apollo Client 4.0."
|
|
409
|
+
},
|
|
410
|
+
24: {
|
|
411
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
412
|
+
message: "[ObservableQuery]: `getLastResult` is deprecated and will be removed in Apollo Client 4.0. Please discontinue using this method."
|
|
413
|
+
},
|
|
414
|
+
25: {
|
|
415
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
416
|
+
message: "[ObservableQuery]: `getLastResult` is deprecated and will be removed in Apollo Client 4.0. Please discontinue using this method."
|
|
417
|
+
},
|
|
418
|
+
26: {
|
|
419
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
420
|
+
message: "[ObservableQuery]: `getLastResult` is deprecated and will be removed in Apollo Client 4.0. Please discontinue using this method."
|
|
421
|
+
},
|
|
422
|
+
27: {
|
|
423
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
424
|
+
message: "[observableQuery.resetQueryStoreErrors]: `resetQueryStoreErrors` is deprecated and will be removed with Apollo Client 4.0. Please discontinue using this method."
|
|
425
|
+
},
|
|
426
|
+
28: {
|
|
403
427
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
404
428
|
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 })?"
|
|
405
429
|
},
|
|
406
|
-
|
|
430
|
+
31: {
|
|
431
|
+
file: "@apollo/client/core/ObservableQuery.js",
|
|
432
|
+
message: "[observableQuery.setOptions] `setOptions` is deprecated and will be removed in Apollo Client 4.0. Please use `observableQuery.reobserve(newOptions)` instead."
|
|
433
|
+
},
|
|
434
|
+
43: {
|
|
407
435
|
file: "@apollo/client/core/QueryManager.js",
|
|
408
436
|
message: "Unknown query named \"%s\" requested in refetchQueries options.include array"
|
|
409
437
|
},
|
|
410
|
-
|
|
438
|
+
44: {
|
|
411
439
|
file: "@apollo/client/core/QueryManager.js",
|
|
412
440
|
message: "Unknown anonymous query requested in refetchQueries options.include array"
|
|
413
441
|
},
|
|
414
|
-
|
|
442
|
+
45: {
|
|
415
443
|
file: "@apollo/client/core/QueryManager.js",
|
|
416
444
|
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.'
|
|
417
445
|
},
|
|
418
|
-
|
|
446
|
+
46: {
|
|
447
|
+
file: "@apollo/client/link/batch-http/batchHttpLink.js",
|
|
448
|
+
message: "[BatchHttpLink]: Apollo Client 4.0 will no longer remove `@client` fields from queries sent through the link chain. Please open an issue if this warning is displayed under standard usage."
|
|
449
|
+
},
|
|
450
|
+
47: {
|
|
419
451
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
420
452
|
message: "You are calling concat on a terminating link, which will have no effect %o"
|
|
421
453
|
},
|
|
422
|
-
|
|
454
|
+
49: {
|
|
455
|
+
file: "@apollo/client/link/core/ApolloLink.js",
|
|
456
|
+
message: "[ApolloLink] `onError` is deprecated and will be removed with Apollo Client 4.0. Please discontinue using it."
|
|
457
|
+
},
|
|
458
|
+
50: {
|
|
459
|
+
file: "@apollo/client/link/core/ApolloLink.js",
|
|
460
|
+
message: "[ApolloLink] `setOnError` is deprecated and will be removed with Apollo Client 4.0. Please discontinue using it."
|
|
461
|
+
},
|
|
462
|
+
52: {
|
|
463
|
+
file: "@apollo/client/link/http/createHttpLink.js",
|
|
464
|
+
message: "[HttpLink]: Apollo Client 4.0 will no longer remove `@client` fields from queries sent through the link chain. Please open an issue if this warning is displayed under standard usage."
|
|
465
|
+
},
|
|
466
|
+
53: {
|
|
423
467
|
file: "@apollo/client/link/http/createHttpLink.js",
|
|
424
468
|
message: "Multipart-subscriptions do not support @defer"
|
|
425
469
|
},
|
|
426
|
-
|
|
470
|
+
57: {
|
|
427
471
|
file: "@apollo/client/link/utils/toPromise.js",
|
|
428
472
|
message: "Promise Wrapper does not support multiple results from Observable"
|
|
429
473
|
},
|
|
430
|
-
|
|
474
|
+
60: {
|
|
431
475
|
file: "@apollo/client/masking/maskDefinition.js",
|
|
432
476
|
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."
|
|
433
477
|
},
|
|
434
|
-
|
|
478
|
+
64: {
|
|
435
479
|
file: "@apollo/client/masking/utils.js",
|
|
436
|
-
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."
|
|
480
|
+
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. Caches will be required to support the necessary data masking APIs in Apollo Client 4.0."
|
|
437
481
|
},
|
|
438
|
-
|
|
482
|
+
65: {
|
|
439
483
|
file: "@apollo/client/react/components/Mutation.js",
|
|
440
484
|
message: "[Mutation]: The `<Mutation />` component is deprecated and will be removed in Apollo Client 4.0. Please use the `useMutation` React hook instead."
|
|
441
485
|
},
|
|
442
|
-
|
|
486
|
+
66: {
|
|
443
487
|
file: "@apollo/client/react/components/Query.js",
|
|
444
488
|
message: "[Query]: The `<Query />` component is deprecated and will be removed in Apollo Client 4.0. Please use an available React hook such as `useQuery` instead."
|
|
445
489
|
},
|
|
446
|
-
|
|
490
|
+
67: {
|
|
447
491
|
file: "@apollo/client/react/components/Subscription.js",
|
|
448
492
|
message: "[Subscription]: The `<Subscription />` component is deprecated and will be removed in Apollo Client 4.0. Please use the `useSubscription` React hook instead."
|
|
449
493
|
},
|
|
450
|
-
|
|
494
|
+
70: {
|
|
451
495
|
file: "@apollo/client/react/context/ApolloContext.js",
|
|
452
496
|
message: "[resetApolloContext]: `resetApolloContext` is deprecated and will be removed in Apollo Client 4.0. Please use `getApolloContext` instead."
|
|
453
497
|
},
|
|
454
|
-
|
|
498
|
+
72: {
|
|
455
499
|
file: "@apollo/client/react/hoc/graphql.js",
|
|
456
500
|
message: "[graphql]: The `graphql` higher order component is deprecated and will be removed in Apollo Client 4.0. Please switch to an available React hook such as `useQuery`, `useMutation`, or `useSubscription`."
|
|
457
501
|
},
|
|
458
|
-
|
|
502
|
+
74: {
|
|
459
503
|
file: "@apollo/client/react/hoc/mutation-hoc.js",
|
|
460
504
|
message: "[withMutation]: The `withMutation` higher order component is deprecated and will be removed in Apollo Client 4.0. Please switch to an available React hook such as `useQuery`."
|
|
461
505
|
},
|
|
462
|
-
|
|
506
|
+
75: {
|
|
463
507
|
file: "@apollo/client/react/hoc/query-hoc.js",
|
|
464
508
|
message: "[withQuery]: The `withQuery` higher order component is deprecated and will be removed in Apollo Client 4.0. Please switch to an available React hook such as `useQuery`."
|
|
465
509
|
},
|
|
466
|
-
|
|
510
|
+
76: {
|
|
467
511
|
file: "@apollo/client/react/hoc/subscription-hoc.js",
|
|
468
512
|
message: "[withSubscription]: The `withSubscription` higher order component is deprecated and will be removed in Apollo Client 4.0. Please switch to an available React hook such as `useSubscription`."
|
|
469
513
|
},
|
|
470
|
-
|
|
514
|
+
78: {
|
|
471
515
|
file: "@apollo/client/react/hooks/internal/useWarnRemovedOption.js",
|
|
472
516
|
message: "[%s]: `%s` is a deprecated hook option and will be removed in Apollo Client 4.0. %s"
|
|
473
517
|
},
|
|
474
|
-
|
|
518
|
+
80: {
|
|
475
519
|
file: "@apollo/client/react/hooks/useLazyQuery.js",
|
|
476
520
|
message: "[useLazyQuery]: `reobserve` is deprecated and will removed in Apollo Client 4.0. Please change options by rerendering `useLazyQuery` with new options."
|
|
477
521
|
},
|
|
478
|
-
|
|
522
|
+
81: {
|
|
479
523
|
file: "@apollo/client/react/hooks/useLazyQuery.js",
|
|
480
524
|
message: "[useLazyQuery]: Calling `execute` in render will throw in Apollo Client 4.0. Either switch to `useQuery` to run the query during render or move the `execute` call inside of `useEffect`."
|
|
481
525
|
},
|
|
482
|
-
|
|
526
|
+
84: {
|
|
483
527
|
file: "@apollo/client/react/hooks/useQuery.js",
|
|
484
528
|
message: "[useQuery]: `reobserve` is deprecated and will removed in Apollo Client 4.0. Please change options by rerendering `useQuery` with new options."
|
|
485
529
|
},
|
|
486
|
-
|
|
530
|
+
85: {
|
|
487
531
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
488
532
|
message: "'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used."
|
|
489
533
|
},
|
|
490
|
-
|
|
534
|
+
86: {
|
|
491
535
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
492
536
|
message: "[useSubscription]: `onSubscriptionData` is deprecated and will be removed in Apollo Client 4.0. Please use the 'onData' option instead."
|
|
493
537
|
},
|
|
494
|
-
|
|
538
|
+
87: {
|
|
495
539
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
496
540
|
message: "'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used."
|
|
497
541
|
},
|
|
498
|
-
|
|
542
|
+
88: {
|
|
499
543
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
500
544
|
message: "[useSubscription]: `onSubscriptionComplete` is deprecated and will be removed in Apollo Client 4.0. Please use the 'onComplete' option instead."
|
|
501
545
|
},
|
|
502
|
-
|
|
546
|
+
91: {
|
|
503
547
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
504
548
|
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."
|
|
505
549
|
},
|
|
506
|
-
|
|
550
|
+
94: {
|
|
507
551
|
file: "@apollo/client/react/parser/index.js",
|
|
508
552
|
message: "[parser]: `parser` is deprecated and will be removed in Apollo Client 4.0. Please remove all usages of `parser`."
|
|
509
553
|
},
|
|
510
|
-
|
|
554
|
+
100: {
|
|
555
|
+
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
556
|
+
message: "[MockLink]: `newData` is deprecated and will be removed in Apollo Client 4.0. Please use the `result` option with a callback function and set the `maxUsageCount` option to `Number.POSITIVE_INFINITY`.\n\nFound `newData` on response:\n%o"
|
|
557
|
+
},
|
|
558
|
+
101: {
|
|
559
|
+
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
560
|
+
message: "[MockLink]: Apollo Client 4.0 will throw when mocking client-only query '%s'. Please ensure the query has at least 1 non-client field."
|
|
561
|
+
},
|
|
562
|
+
104: {
|
|
511
563
|
file: "@apollo/client/utilities/deprecation/index.js",
|
|
512
564
|
message: "[%s]: `%s` is deprecated and will be removed in Apollo Client 4.0. %s"
|
|
513
565
|
},
|
|
514
|
-
|
|
566
|
+
110: {
|
|
515
567
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
516
568
|
message: "@unmask 'mode' argument does not support variables."
|
|
517
569
|
},
|
|
518
|
-
|
|
570
|
+
111: {
|
|
519
571
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
520
572
|
message: "@unmask 'mode' argument must be of type string."
|
|
521
573
|
},
|
|
522
|
-
|
|
574
|
+
112: {
|
|
523
575
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
524
576
|
message: "@unmask 'mode' argument does not recognize value '%s'."
|
|
525
577
|
},
|
|
526
|
-
|
|
578
|
+
126: {
|
|
527
579
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
528
580
|
message: "Removing an @connection directive even though it does not have a key. " +
|
|
529
581
|
"You may want to use the key parameter to specify a store key."
|
|
@@ -534,25 +586,25 @@ const devError = {
|
|
|
534
586
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
535
587
|
message: "Missing field '%s' while writing result %o"
|
|
536
588
|
},
|
|
537
|
-
|
|
589
|
+
30: {
|
|
538
590
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
539
591
|
message: "Unhandled GraphQL subscription error"
|
|
540
592
|
},
|
|
541
|
-
|
|
593
|
+
33: {
|
|
542
594
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
543
595
|
message: "Unhandled error"
|
|
544
596
|
},
|
|
545
|
-
|
|
597
|
+
92: {
|
|
546
598
|
file: "@apollo/client/react/hooks/useSyncExternalStore.js",
|
|
547
599
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
548
600
|
},
|
|
549
|
-
|
|
601
|
+
125: {
|
|
550
602
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
551
603
|
message: "Could not find operation or fragment"
|
|
552
604
|
}
|
|
553
605
|
};
|
|
554
606
|
|
|
555
|
-
var version = "3.14.0-alpha.
|
|
607
|
+
var version = "3.14.0-alpha.1";
|
|
556
608
|
|
|
557
609
|
function maybe(thunk) {
|
|
558
610
|
try {
|