@apollo/client 3.11.7 → 3.12.0-alpha.0
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/nasty-camels-pay.md +36 -0
- package/.changeset/pre.json +10 -0
- package/CHANGELOG.md +43 -0
- package/apollo-client.cjs +438 -111
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +218 -22
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +218 -22
- package/cache/core/cache.d.ts +13 -10
- package/cache/core/cache.js +32 -14
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +2 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +4 -3
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/inMemoryCache.d.ts +3 -1
- package/cache/inmemory/inMemoryCache.js +7 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- 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/core/ApolloClient.d.ts +14 -6
- package/core/ApolloClient.js +14 -6
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.d.ts +17 -14
- package/core/ObservableQuery.js +29 -16
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +18 -3
- package/core/QueryManager.js +39 -14
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +285 -37
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +285 -37
- package/core/index.d.ts +1 -0
- package/core/index.js.map +1 -1
- package/core/masking.d.ts +4 -0
- package/core/masking.js +212 -0
- package/core/masking.js.map +1 -0
- package/core/types.d.ts +3 -2
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +8 -6
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +131 -87
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +131 -87
- package/invariantErrorCodes.js +140 -86
- package/link/core/ApolloLink.js +2 -2
- package/link/core/core.cjs +2 -2
- package/link/core/core.cjs.map +1 -1
- package/link/core/core.cjs.native.js +2 -2
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/http.cjs +6 -6
- package/link/http/http.cjs.map +1 -1
- package/link/http/http.cjs.native.js +6 -6
- package/link/http/selectHttpOptionsAndBody.js +3 -3
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- 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/toPromise.js +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/index.d.ts +2 -0
- package/masking/index.js +2 -0
- package/masking/index.js.map +1 -0
- package/masking/internal/types.d.ts +15 -0
- package/masking/internal/types.js +2 -0
- package/masking/internal/types.js.map +1 -0
- package/masking/masking.cjs +3 -0
- package/masking/masking.cjs.map +1 -0
- package/masking/masking.cjs.native.js +3 -0
- package/masking/masking.d.cts +1 -0
- package/masking/package.json +8 -0
- package/masking/types.d.ts +44 -0
- package/masking/types.js +2 -0
- package/masking/types.js.map +1 -0
- package/package.json +2 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/context.cjs +3 -3
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +3 -3
- package/react/hoc/hoc-utils.js +1 -1
- package/react/hoc/hoc.cjs +2 -2
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +2 -2
- package/react/hoc/withApollo.js +1 -1
- package/react/hooks/hooks.cjs +24 -16
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +24 -16
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useFragment.d.ts +4 -3
- package/react/hooks/useFragment.js +12 -5
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.js +1 -1
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useQuery.d.ts +4 -3
- package/react/hooks/useQuery.js +2 -1
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +2 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +2 -1
- package/react/hooks/useSubscription.js +3 -3
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +6 -5
- package/react/hooks/useSuspenseQuery.js +2 -2
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.d.ts +5 -4
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/internal.cjs +2 -2
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +2 -2
- package/react/parser/index.js +5 -5
- package/react/parser/parser.cjs +5 -5
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +5 -5
- package/react/types/types.d.ts +18 -42
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +3 -3
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +3 -3
- package/testing/core/mocking/mockLink.d.ts +3 -2
- package/testing/core/mocking/mockLink.js +3 -3
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockQueryManager.d.ts +1 -0
- package/testing/core/mocking/mockQueryManager.js +1 -1
- package/testing/core/mocking/mockQueryManager.js.map +1 -1
- package/testing/internal/disposables/index.d.ts +1 -0
- package/testing/internal/disposables/index.js +1 -0
- package/testing/internal/disposables/index.js.map +1 -1
- package/testing/internal/disposables/withProdMode.d.ts +4 -0
- package/testing/internal/disposables/withProdMode.js +10 -0
- package/testing/internal/disposables/withProdMode.js.map +1 -0
- package/testing/internal/scenarios/index.d.ts +28 -0
- package/testing/internal/scenarios/index.js +18 -2
- package/testing/internal/scenarios/index.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.d.ts +1 -0
- package/utilities/common/maybeDeepFreeze.js +1 -1
- package/utilities/common/maybeDeepFreeze.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.d.ts +3 -1
- package/utilities/graphql/directives.js +39 -5
- package/utilities/graphql/directives.js.map +1 -1
- 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.d.ts +1 -0
- package/utilities/graphql/transform.js +15 -2
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.d.ts +7 -3
- package/utilities/index.js +4 -3
- package/utilities/index.js.map +1 -1
- package/utilities/promises/preventUnhandledRejection.d.ts +2 -0
- package/utilities/promises/preventUnhandledRejection.js +5 -0
- package/utilities/promises/preventUnhandledRejection.js.map +1 -0
- package/utilities/subscriptions/relay/relay.cjs.map +1 -1
- package/utilities/subscriptions/urql/urql.cjs.map +1 -1
- package/utilities/types/NoInfer.d.ts +27 -0
- package/utilities/types/NoInfer.js +2 -0
- package/utilities/types/NoInfer.js.map +1 -0
- package/utilities/types/Prettify.d.ts +4 -0
- package/utilities/types/Prettify.js +2 -0
- package/utilities/types/Prettify.js.map +1 -0
- package/utilities/types/UnionToIntersection.d.ts +2 -0
- package/utilities/types/UnionToIntersection.js +2 -0
- package/utilities/types/UnionToIntersection.js.map +1 -0
- package/utilities/utilities.cjs +73 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +73 -19
- package/version.js +1 -1
package/dev/dev.cjs
CHANGED
|
@@ -7,49 +7,49 @@ var tsInvariant = require('ts-invariant');
|
|
|
7
7
|
|
|
8
8
|
const errorCodes =
|
|
9
9
|
{
|
|
10
|
-
|
|
10
|
+
2: {
|
|
11
11
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
12
12
|
condition: "typeof dataId === \"string\"",
|
|
13
13
|
message: "store.merge expects a string ID"
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
5: {
|
|
16
16
|
file: "@apollo/client/cache/inmemory/key-extractor.js",
|
|
17
17
|
condition: "extracted !== void 0",
|
|
18
18
|
message: "Missing field '%s' while extracting keyFields from %s"
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
6: {
|
|
21
21
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
22
22
|
condition: "!old || old === which",
|
|
23
23
|
message: "Cannot change root %s __typename more than once"
|
|
24
24
|
},
|
|
25
|
-
|
|
25
|
+
9: {
|
|
26
26
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
27
27
|
message: "Cannot automatically merge arrays"
|
|
28
28
|
},
|
|
29
|
-
|
|
29
|
+
10: {
|
|
30
30
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
31
31
|
message: "No fragment named %s"
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
11: {
|
|
34
34
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
35
35
|
condition: "!isReference(value)",
|
|
36
36
|
message: "Missing selection set for object of type %s returned for query field %s"
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
12: {
|
|
39
39
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
40
40
|
message: "Could not identify object %s"
|
|
41
41
|
},
|
|
42
|
-
|
|
42
|
+
14: {
|
|
43
43
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
44
44
|
message: "No fragment named %s"
|
|
45
45
|
},
|
|
46
|
-
|
|
46
|
+
16: {
|
|
47
47
|
file: "@apollo/client/core/ApolloClient.js",
|
|
48
48
|
message: "To initialize Apollo Client, you must specify a 'cache' property " +
|
|
49
49
|
"in the options object. \n" +
|
|
50
50
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
51
51
|
},
|
|
52
|
-
|
|
52
|
+
17: {
|
|
53
53
|
file: "@apollo/client/core/ApolloClient.js",
|
|
54
54
|
condition: "options.fetchPolicy !== \"cache-and-network\"",
|
|
55
55
|
message: "The cache-and-network fetchPolicy does not work with client.query, because " +
|
|
@@ -57,100 +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
|
+
19: {
|
|
61
61
|
file: "@apollo/client/core/LocalState.js",
|
|
62
62
|
condition: "fragment",
|
|
63
63
|
message: "No fragment named %s"
|
|
64
64
|
},
|
|
65
|
-
|
|
65
|
+
20: {
|
|
66
66
|
file: "@apollo/client/core/LocalState.js",
|
|
67
67
|
condition: "fragment",
|
|
68
68
|
message: "No fragment named %s"
|
|
69
69
|
},
|
|
70
|
-
|
|
70
|
+
22: {
|
|
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
|
+
24: {
|
|
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
|
+
27: {
|
|
81
81
|
file: "@apollo/client/core/QueryManager.js",
|
|
82
82
|
message: "QueryManager stopped while query was in flight"
|
|
83
83
|
},
|
|
84
|
-
|
|
84
|
+
28: {
|
|
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
|
+
29: {
|
|
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
|
+
30: {
|
|
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
|
+
31: {
|
|
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
|
+
32: {
|
|
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
|
+
33: {
|
|
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
|
+
34: {
|
|
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
|
37: {
|
|
120
|
+
file: "@apollo/client/core/masking.js",
|
|
121
|
+
condition: "definition",
|
|
122
|
+
message: "Expected a parsed GraphQL document with a query, mutation, or subscription."
|
|
123
|
+
},
|
|
124
|
+
38: {
|
|
125
|
+
file: "@apollo/client/core/masking.js",
|
|
126
|
+
condition: "fragments.length === 1",
|
|
127
|
+
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
128
|
+
},
|
|
129
|
+
39: {
|
|
130
|
+
file: "@apollo/client/core/masking.js",
|
|
131
|
+
condition: "!!fragment",
|
|
132
|
+
message: "Could not find fragment with name \"%s\"."
|
|
133
|
+
},
|
|
134
|
+
40: {
|
|
135
|
+
file: "@apollo/client/core/masking.js",
|
|
136
|
+
condition: "fragment",
|
|
137
|
+
message: "Could not find fragment with name '%s'."
|
|
138
|
+
},
|
|
139
|
+
44: {
|
|
120
140
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
121
141
|
message: "request is not implemented"
|
|
122
142
|
},
|
|
123
|
-
|
|
143
|
+
45: {
|
|
124
144
|
file: "@apollo/client/link/http/checkFetcher.js",
|
|
125
145
|
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
146
|
},
|
|
127
|
-
|
|
147
|
+
47: {
|
|
128
148
|
file: "@apollo/client/link/http/serializeFetchParameter.js",
|
|
129
149
|
message: "Network request failed. %s is not serializable: %s"
|
|
130
150
|
},
|
|
131
|
-
|
|
151
|
+
48: {
|
|
132
152
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
133
153
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
134
154
|
message: 'Missing/invalid "sha256" or "generateHash" function. Please ' +
|
|
135
155
|
'configure one using the "createPersistedQueryLink(options)" options ' +
|
|
136
156
|
"parameter."
|
|
137
157
|
},
|
|
138
|
-
|
|
158
|
+
49: {
|
|
139
159
|
file: "@apollo/client/link/persisted-queries/index.js",
|
|
140
160
|
condition: "forward",
|
|
141
161
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
142
162
|
},
|
|
143
|
-
|
|
163
|
+
51: {
|
|
144
164
|
file: "@apollo/client/link/utils/validateOperation.js",
|
|
145
165
|
message: "illegal argument: %s"
|
|
146
166
|
},
|
|
147
|
-
|
|
167
|
+
52: {
|
|
148
168
|
file: "@apollo/client/react/context/ApolloConsumer.js",
|
|
149
169
|
condition: "context && context.client",
|
|
150
170
|
message: 'Could not find "client" in the context of ApolloConsumer. ' +
|
|
151
171
|
"Wrap the root component in an <ApolloProvider>."
|
|
152
172
|
},
|
|
153
|
-
|
|
173
|
+
53: {
|
|
154
174
|
file: "@apollo/client/react/context/ApolloContext.js",
|
|
155
175
|
condition: "\"createContext\" in React",
|
|
156
176
|
message: "Invoking `getApolloContext` in an environment where `React.createContext` is not available.\n" +
|
|
@@ -158,70 +178,70 @@ const errorCodes =
|
|
|
158
178
|
'Please make sure to add "use client" at the top of your file.\n' +
|
|
159
179
|
"For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
|
|
160
180
|
},
|
|
161
|
-
|
|
181
|
+
54: {
|
|
162
182
|
file: "@apollo/client/react/context/ApolloProvider.js",
|
|
163
183
|
condition: "context.client",
|
|
164
184
|
message: "ApolloProvider was not passed a client instance. Make " +
|
|
165
185
|
'sure you pass in your client via the "client" prop.'
|
|
166
186
|
},
|
|
167
|
-
|
|
187
|
+
55: {
|
|
168
188
|
file: "@apollo/client/react/hoc/hoc-utils.js",
|
|
169
189
|
condition: "this.withRef",
|
|
170
190
|
message: "To access the wrapped instance, you need to specify " +
|
|
171
191
|
"{ withRef: true } in the options"
|
|
172
192
|
},
|
|
173
|
-
|
|
193
|
+
56: {
|
|
174
194
|
file: "@apollo/client/react/hoc/withApollo.js",
|
|
175
195
|
condition: "operationOptions.withRef",
|
|
176
196
|
message: "To access the wrapped instance, you need to specify " +
|
|
177
197
|
"{ withRef: true } in the options"
|
|
178
198
|
},
|
|
179
|
-
|
|
199
|
+
57: {
|
|
180
200
|
file: "@apollo/client/react/hooks/useApolloClient.js",
|
|
181
201
|
condition: "!!client",
|
|
182
202
|
message: 'Could not find "client" in the context or passed in as an option. ' +
|
|
183
203
|
"Wrap the root component in an <ApolloProvider>, or pass an ApolloClient " +
|
|
184
204
|
"instance in via options."
|
|
185
205
|
},
|
|
186
|
-
|
|
206
|
+
58: {
|
|
187
207
|
file: "@apollo/client/react/hooks/useLoadableQuery.js",
|
|
188
208
|
condition: "!calledDuringRender()",
|
|
189
209
|
message: "useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook."
|
|
190
210
|
},
|
|
191
|
-
|
|
211
|
+
59: {
|
|
192
212
|
file: "@apollo/client/react/hooks/useLoadableQuery.js",
|
|
193
213
|
condition: "internalQueryRef",
|
|
194
214
|
message: "The query has not been loaded. Please load the query."
|
|
195
215
|
},
|
|
196
|
-
|
|
216
|
+
64: {
|
|
197
217
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
198
218
|
condition: "!optionsRef.current.skip",
|
|
199
219
|
message: "A subscription that is skipped cannot be restarted."
|
|
200
220
|
},
|
|
201
|
-
|
|
221
|
+
65: {
|
|
202
222
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
203
223
|
condition: "supportedFetchPolicies.includes(fetchPolicy)",
|
|
204
224
|
message: "The fetch policy `%s` is not supported with suspense."
|
|
205
225
|
},
|
|
206
|
-
|
|
226
|
+
68: {
|
|
207
227
|
file: "@apollo/client/react/internal/cache/QueryReference.js",
|
|
208
228
|
condition: "!queryRef || QUERY_REFERENCE_SYMBOL in queryRef",
|
|
209
229
|
message: "Expected a QueryRef object, but got something else instead."
|
|
210
230
|
},
|
|
211
|
-
|
|
231
|
+
69: {
|
|
212
232
|
file: "@apollo/client/react/parser/index.js",
|
|
213
233
|
condition: "!!document && !!document.kind",
|
|
214
234
|
message: "Argument of %s passed to parser was not a valid GraphQL " +
|
|
215
235
|
"DocumentNode. You may need to use 'graphql-tag' or another method " +
|
|
216
236
|
"to convert your operation into a document"
|
|
217
237
|
},
|
|
218
|
-
|
|
238
|
+
70: {
|
|
219
239
|
file: "@apollo/client/react/parser/index.js",
|
|
220
240
|
condition: "!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length",
|
|
221
241
|
message: "Passing only a fragment to 'graphql' is not yet supported. " +
|
|
222
242
|
"You must include a query, subscription or mutation as well"
|
|
223
243
|
},
|
|
224
|
-
|
|
244
|
+
71: {
|
|
225
245
|
file: "@apollo/client/react/parser/index.js",
|
|
226
246
|
condition: "queries.length + mutations.length + subscriptions.length <= 1",
|
|
227
247
|
message: "react-apollo only supports a query, subscription, or a mutation per HOC. " +
|
|
@@ -229,107 +249,107 @@ const errorCodes =
|
|
|
229
249
|
"subscriptions and %s mutations. " +
|
|
230
250
|
"You can use 'compose' to join multiple operation types to a component"
|
|
231
251
|
},
|
|
232
|
-
|
|
252
|
+
72: {
|
|
233
253
|
file: "@apollo/client/react/parser/index.js",
|
|
234
254
|
condition: "definitions.length === 1",
|
|
235
255
|
message: "react-apollo only supports one definition per HOC. %s had " +
|
|
236
256
|
"%s definitions. " +
|
|
237
257
|
"You can use 'compose' to join multiple operation types to a component"
|
|
238
258
|
},
|
|
239
|
-
|
|
259
|
+
73: {
|
|
240
260
|
file: "@apollo/client/react/parser/index.js",
|
|
241
261
|
condition: "operation.type === type",
|
|
242
262
|
message: "Running a %s requires a graphql " + "%s, but a %s was used instead."
|
|
243
263
|
},
|
|
244
|
-
|
|
264
|
+
74: {
|
|
245
265
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
246
266
|
condition: "queryWithoutClientOnlyDirectives",
|
|
247
267
|
message: "query is required"
|
|
248
268
|
},
|
|
249
|
-
|
|
269
|
+
75: {
|
|
250
270
|
file: "@apollo/client/testing/core/mocking/mockLink.js",
|
|
251
271
|
condition: "mockedResponse.maxUsageCount > 0",
|
|
252
272
|
message: "Mock response maxUsageCount must be greater than 0, %s given"
|
|
253
273
|
},
|
|
254
|
-
|
|
274
|
+
76: {
|
|
255
275
|
file: "@apollo/client/utilities/graphql/DocumentTransform.js",
|
|
256
276
|
condition: "Array.isArray(cacheKeys)",
|
|
257
277
|
message: "`getCacheKey` must return an array or undefined"
|
|
258
278
|
},
|
|
259
|
-
|
|
279
|
+
77: {
|
|
260
280
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
261
281
|
condition: "evaledValue !== void 0",
|
|
262
282
|
message: "Invalid variable referenced in @%s directive."
|
|
263
283
|
},
|
|
264
|
-
|
|
284
|
+
78: {
|
|
265
285
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
266
286
|
condition: "directiveArguments && directiveArguments.length === 1",
|
|
267
287
|
message: "Incorrect number of arguments for the @%s directive."
|
|
268
288
|
},
|
|
269
|
-
|
|
289
|
+
79: {
|
|
270
290
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
271
291
|
condition: "ifArgument.name && ifArgument.name.value === \"if\"",
|
|
272
292
|
message: "Invalid argument for the @%s directive."
|
|
273
293
|
},
|
|
274
|
-
|
|
294
|
+
80: {
|
|
275
295
|
file: "@apollo/client/utilities/graphql/directives.js",
|
|
276
296
|
condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
|
|
277
297
|
message: "Argument for the @%s directive must be a variable or a boolean value."
|
|
278
298
|
},
|
|
279
|
-
|
|
299
|
+
84: {
|
|
280
300
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
281
301
|
message: "Found a %s operation%s. " +
|
|
282
302
|
"No operations are allowed when using a fragment as a query. Only fragments are allowed."
|
|
283
303
|
},
|
|
284
|
-
|
|
304
|
+
85: {
|
|
285
305
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
286
306
|
condition: "fragments.length === 1",
|
|
287
307
|
message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
|
|
288
308
|
},
|
|
289
|
-
|
|
309
|
+
86: {
|
|
290
310
|
file: "@apollo/client/utilities/graphql/fragments.js",
|
|
291
311
|
condition: "fragment",
|
|
292
312
|
message: "No fragment named %s"
|
|
293
313
|
},
|
|
294
|
-
|
|
314
|
+
87: {
|
|
295
315
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
296
316
|
condition: "doc && doc.kind === \"Document\"",
|
|
297
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"
|
|
298
318
|
},
|
|
299
|
-
|
|
319
|
+
88: {
|
|
300
320
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
301
321
|
message: "Schema type definitions not allowed in queries. Found: \"%s\""
|
|
302
322
|
},
|
|
303
|
-
|
|
323
|
+
89: {
|
|
304
324
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
305
325
|
condition: "operations.length <= 1",
|
|
306
326
|
message: "Ambiguous GraphQL document: contains %s operations"
|
|
307
327
|
},
|
|
308
|
-
|
|
328
|
+
90: {
|
|
309
329
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
310
330
|
condition: "queryDef && queryDef.operation === \"query\"",
|
|
311
331
|
message: "Must contain a query definition."
|
|
312
332
|
},
|
|
313
|
-
|
|
333
|
+
91: {
|
|
314
334
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
315
335
|
condition: "doc.kind === \"Document\"",
|
|
316
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"
|
|
317
337
|
},
|
|
318
|
-
|
|
338
|
+
92: {
|
|
319
339
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
320
340
|
condition: "doc.definitions.length <= 1",
|
|
321
341
|
message: "Fragment must have exactly one definition."
|
|
322
342
|
},
|
|
323
|
-
|
|
343
|
+
93: {
|
|
324
344
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
325
345
|
condition: "fragmentDef.kind === \"FragmentDefinition\"",
|
|
326
346
|
message: "Must be a fragment definition."
|
|
327
347
|
},
|
|
328
|
-
|
|
348
|
+
94: {
|
|
329
349
|
file: "@apollo/client/utilities/graphql/getFromAST.js",
|
|
330
350
|
message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
|
|
331
351
|
},
|
|
332
|
-
|
|
352
|
+
95: {
|
|
333
353
|
file: "@apollo/client/utilities/graphql/storeUtils.js",
|
|
334
354
|
message: "The inline argument \"%s\" of kind \"%s\"" +
|
|
335
355
|
"is not supported. Use variables instead of inline arguments to " +
|
|
@@ -337,114 +357,138 @@ const errorCodes =
|
|
|
337
357
|
}
|
|
338
358
|
};
|
|
339
359
|
const devDebug = {
|
|
340
|
-
|
|
360
|
+
18: {
|
|
341
361
|
file: "@apollo/client/core/ApolloClient.js",
|
|
342
362
|
message: "In client.refetchQueries, Promise.all promise rejected with error %o"
|
|
343
363
|
},
|
|
344
|
-
|
|
364
|
+
26: {
|
|
345
365
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
346
366
|
message: "Missing cache result fields: %o"
|
|
347
367
|
}
|
|
348
368
|
};
|
|
349
369
|
const devLog = {};
|
|
350
370
|
const devWarn = {
|
|
351
|
-
|
|
371
|
+
1: {
|
|
372
|
+
file: "@apollo/client/cache/core/cache.js",
|
|
373
|
+
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."
|
|
374
|
+
},
|
|
375
|
+
3: {
|
|
352
376
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
353
377
|
message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
|
|
354
378
|
"Please make sure to set the `mergeIntoStore` parameter to `true` when creating a Reference that is not part of the store yet:\n" +
|
|
355
379
|
"`toReference(object, true)`"
|
|
356
380
|
},
|
|
357
|
-
|
|
381
|
+
4: {
|
|
358
382
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
359
383
|
message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
|
|
360
384
|
"Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
|
|
361
385
|
},
|
|
362
|
-
|
|
386
|
+
7: {
|
|
363
387
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
364
388
|
message: "Inferring subtype %s of supertype %s"
|
|
365
389
|
},
|
|
366
|
-
|
|
390
|
+
8: {
|
|
367
391
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
368
392
|
message: "Undefined 'from' passed to readField with arguments %s"
|
|
369
393
|
},
|
|
370
|
-
|
|
394
|
+
15: {
|
|
371
395
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
372
396
|
message: "Cache data may be lost when replacing the %s field of a %s object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:\n\n existing: %o\n incoming: %o\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"
|
|
373
397
|
},
|
|
374
|
-
|
|
398
|
+
21: {
|
|
375
399
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
376
400
|
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 })?"
|
|
377
401
|
},
|
|
378
|
-
|
|
402
|
+
35: {
|
|
379
403
|
file: "@apollo/client/core/QueryManager.js",
|
|
380
404
|
message: "Unknown query named \"%s\" requested in refetchQueries options.include array"
|
|
381
405
|
},
|
|
382
|
-
|
|
406
|
+
36: {
|
|
383
407
|
file: "@apollo/client/core/QueryManager.js",
|
|
384
408
|
message: "Unknown query %o requested in refetchQueries options.include array"
|
|
385
409
|
},
|
|
386
|
-
|
|
410
|
+
41: {
|
|
411
|
+
file: "@apollo/client/core/masking.js",
|
|
412
|
+
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."
|
|
413
|
+
},
|
|
414
|
+
42: {
|
|
415
|
+
file: "@apollo/client/core/masking.js",
|
|
416
|
+
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."
|
|
417
|
+
},
|
|
418
|
+
43: {
|
|
387
419
|
file: "@apollo/client/link/core/ApolloLink.js",
|
|
388
420
|
message: "You are calling concat on a terminating link, which will have no effect %o"
|
|
389
421
|
},
|
|
390
|
-
|
|
422
|
+
46: {
|
|
391
423
|
file: "@apollo/client/link/http/createHttpLink.js",
|
|
392
424
|
message: "Multipart-subscriptions do not support @defer"
|
|
393
425
|
},
|
|
394
|
-
|
|
426
|
+
50: {
|
|
395
427
|
file: "@apollo/client/link/utils/toPromise.js",
|
|
396
428
|
message: "Promise Wrapper does not support multiple results from Observable"
|
|
397
429
|
},
|
|
398
|
-
|
|
430
|
+
60: {
|
|
399
431
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
400
432
|
message: "'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used."
|
|
401
433
|
},
|
|
402
|
-
|
|
434
|
+
61: {
|
|
403
435
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
404
436
|
message: "'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead."
|
|
405
437
|
},
|
|
406
|
-
|
|
438
|
+
62: {
|
|
407
439
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
408
440
|
message: "'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used."
|
|
409
441
|
},
|
|
410
|
-
|
|
442
|
+
63: {
|
|
411
443
|
file: "@apollo/client/react/hooks/useSubscription.js",
|
|
412
444
|
message: "'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead."
|
|
413
445
|
},
|
|
414
|
-
|
|
446
|
+
66: {
|
|
415
447
|
file: "@apollo/client/react/hooks/useSuspenseQuery.js",
|
|
416
448
|
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."
|
|
417
449
|
},
|
|
418
|
-
|
|
450
|
+
81: {
|
|
451
|
+
file: "@apollo/client/utilities/graphql/directives.js",
|
|
452
|
+
message: "@unmask 'mode' argument does not support variables."
|
|
453
|
+
},
|
|
454
|
+
82: {
|
|
455
|
+
file: "@apollo/client/utilities/graphql/directives.js",
|
|
456
|
+
message: "@unmask 'mode' argument must be of type string."
|
|
457
|
+
},
|
|
458
|
+
83: {
|
|
459
|
+
file: "@apollo/client/utilities/graphql/directives.js",
|
|
460
|
+
message: "@unmask 'mode' argument does not recognize value '%s'."
|
|
461
|
+
},
|
|
462
|
+
97: {
|
|
419
463
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
420
464
|
message: "Removing an @connection directive even though it does not have a key. " +
|
|
421
465
|
"You may want to use the key parameter to specify a store key."
|
|
422
466
|
}
|
|
423
467
|
};
|
|
424
468
|
const devError = {
|
|
425
|
-
|
|
469
|
+
13: {
|
|
426
470
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
427
471
|
message: "Missing field '%s' while writing result %o"
|
|
428
472
|
},
|
|
429
|
-
|
|
473
|
+
23: {
|
|
430
474
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
431
475
|
message: "Unhandled GraphQL subscription error"
|
|
432
476
|
},
|
|
433
|
-
|
|
477
|
+
25: {
|
|
434
478
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
435
479
|
message: "Unhandled error"
|
|
436
480
|
},
|
|
437
|
-
|
|
481
|
+
67: {
|
|
438
482
|
file: "@apollo/client/react/hooks/useSyncExternalStore.js",
|
|
439
483
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
440
484
|
},
|
|
441
|
-
|
|
485
|
+
96: {
|
|
442
486
|
file: "@apollo/client/utilities/graphql/transform.js",
|
|
443
487
|
message: "Could not find operation or fragment"
|
|
444
488
|
}
|
|
445
489
|
};
|
|
446
490
|
|
|
447
|
-
var version = "3.
|
|
491
|
+
var version = "3.12.0-alpha.0";
|
|
448
492
|
|
|
449
493
|
function maybe(thunk) {
|
|
450
494
|
try {
|