@apollo/client 4.0.0-alpha.21 → 4.0.0-alpha.22
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/CHANGELOG.md +103 -0
- package/__cjs/core/ApolloClient.cjs +13 -10
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +7 -8
- package/__cjs/core/ObservableQuery.cjs +5 -5
- package/__cjs/core/QueryManager.cjs +18 -13
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +13 -6
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/index.d.cts +1 -1
- package/__cjs/core/types.d.cts +5 -4
- package/__cjs/invariantErrorCodes.cjs +79 -79
- package/__cjs/link/batch-http/batchHttpLink.cjs +14 -14
- package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
- package/__cjs/link/batch-http/batchHttpLink.d.cts +4 -0
- package/__cjs/link/batch-http/index.cjs +2 -1
- package/__cjs/link/batch-http/index.cjs.map +1 -1
- package/__cjs/link/batch-http/index.d.cts +1 -1
- package/__cjs/link/client-awareness/ClientAwarenessLink.cjs +45 -0
- package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -0
- package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +62 -0
- package/__cjs/link/client-awareness/index.cjs +6 -0
- package/__cjs/link/client-awareness/index.cjs.map +1 -0
- package/__cjs/link/client-awareness/index.d.cts +2 -0
- package/__cjs/link/core/types.d.cts +1 -6
- package/__cjs/link/http/BaseHttpLink.cjs +117 -0
- package/__cjs/link/http/BaseHttpLink.cjs.map +1 -0
- package/__cjs/link/http/BaseHttpLink.d.cts +6 -0
- package/__cjs/link/http/HttpLink.cjs +8 -5
- package/__cjs/link/http/HttpLink.cjs.map +1 -1
- package/__cjs/link/http/HttpLink.d.cts +16 -4
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/index.cjs +4 -3
- package/__cjs/link/http/index.cjs.map +1 -1
- package/__cjs/link/http/index.d.cts +2 -2
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs +6 -5
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
- package/__cjs/link/persisted-queries/index.cjs +9 -7
- package/__cjs/link/persisted-queries/index.cjs.map +1 -1
- package/__cjs/link/utils/validateOperation.cjs +1 -1
- package/__cjs/local-state/LocalState.cjs +10 -18
- package/__cjs/local-state/LocalState.cjs.map +1 -1
- package/__cjs/masking/maskDefinition.cjs +2 -2
- package/__cjs/masking/maskFragment.cjs +2 -2
- package/__cjs/masking/maskOperation.cjs +1 -1
- package/__cjs/masking/utils.cjs +3 -3
- package/__cjs/react/context/ApolloConsumer.cjs +1 -1
- package/__cjs/react/context/ApolloContext.cjs +1 -1
- package/__cjs/react/context/ApolloProvider.cjs +1 -1
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
- package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
- package/__cjs/react/hooks/useSubscription.cjs +1 -1
- package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
- package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
- package/__cjs/testing/core/mocking/mockLink.cjs +4 -4
- package/__cjs/utilities/caching/sizes.cjs.map +1 -1
- package/__cjs/utilities/caching/sizes.d.cts +6 -0
- package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
- package/__cjs/utilities/internal/checkDocument.cjs +47 -13
- package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
- package/__cjs/utilities/internal/checkDocument.d.cts +1 -1
- package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs +1 -1
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +2 -2
- package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
- package/__cjs/utilities/internal/getMemoryInternals.cjs +1 -0
- package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
- package/__cjs/utilities/internal/getMemoryInternals.d.cts +0 -1
- package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
- package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +1 -1
- package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
- package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
- package/__cjs/version.cjs +1 -1
- package/core/ApolloClient.d.ts +7 -8
- package/core/ApolloClient.js +14 -11
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.js +5 -5
- package/core/QueryManager.d.ts +13 -6
- package/core/QueryManager.js +18 -13
- package/core/QueryManager.js.map +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js.map +1 -1
- package/core/types.d.ts +5 -4
- package/invariantErrorCodes.js +79 -79
- package/legacyEntryPoints/link/client-awareness/client-awareness.cjs +1 -0
- package/legacyEntryPoints/link/client-awareness/client-awareness.d.cts +1 -0
- package/legacyEntryPoints/link/client-awareness/index.d.ts +1 -0
- package/legacyEntryPoints/link/client-awareness/index.js +1 -0
- package/link/batch-http/batchHttpLink.d.ts +4 -0
- package/link/batch-http/batchHttpLink.js +11 -12
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/batch-http/index.d.ts +1 -1
- package/link/batch-http/index.js +1 -1
- package/link/batch-http/index.js.map +1 -1
- package/link/client-awareness/ClientAwarenessLink.d.ts +62 -0
- package/link/client-awareness/ClientAwarenessLink.js +41 -0
- package/link/client-awareness/ClientAwarenessLink.js.map +1 -0
- package/link/client-awareness/index.d.ts +2 -0
- package/link/client-awareness/index.js +2 -0
- package/link/client-awareness/index.js.map +1 -0
- package/link/core/types.d.ts +1 -6
- package/link/http/BaseHttpLink.d.ts +6 -0
- package/link/http/BaseHttpLink.js +113 -0
- package/link/http/BaseHttpLink.js.map +1 -0
- package/link/http/HttpLink.d.ts +16 -4
- package/link/http/HttpLink.js +6 -4
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/index.d.ts +2 -2
- package/link/http/index.js +2 -2
- package/link/http/index.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +6 -5
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/persisted-queries/index.js +9 -7
- package/link/persisted-queries/index.js.map +1 -1
- package/link/utils/validateOperation.js +1 -1
- package/local-state/LocalState.js +10 -18
- package/local-state/LocalState.js.map +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/utils.js +3 -3
- package/package.json +7 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useLazyQuery.js +2 -2
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useSubscription.js +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/ssr/prerenderStatic.js +2 -2
- package/testing/core/mocking/mockLink.js +4 -4
- package/utilities/caching/sizes.d.ts +6 -0
- package/utilities/caching/sizes.js.map +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/internal/checkDocument.d.ts +1 -1
- package/utilities/internal/checkDocument.js +46 -12
- package/utilities/internal/checkDocument.js.map +1 -1
- package/utilities/internal/getFragmentDefinition.js +3 -3
- package/utilities/internal/getFragmentFromSelection.js +1 -1
- package/utilities/internal/getFragmentQueryDocument.js +2 -2
- package/utilities/internal/getMainDefinition.js +1 -1
- package/utilities/internal/getMemoryInternals.d.ts +0 -1
- package/utilities/internal/getMemoryInternals.js +1 -0
- package/utilities/internal/getMemoryInternals.js.map +1 -1
- package/utilities/internal/getQueryDefinition.js +1 -1
- package/utilities/internal/removeDirectivesFromDocument.js +1 -1
- package/utilities/internal/shouldInclude.js +4 -4
- package/utilities/internal/valueToObjectRepresentation.js +1 -1
- package/version.js +1 -1
- package/__cjs/link/http/createHttpLink.cjs +0 -151
- package/__cjs/link/http/createHttpLink.cjs.map +0 -1
- package/__cjs/link/http/createHttpLink.d.cts +0 -4
- package/link/http/createHttpLink.d.ts +0 -4
- package/link/http/createHttpLink.js +0 -143
- package/link/http/createHttpLink.js.map +0 -1
|
@@ -28,6 +28,11 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
28
28
|
},
|
|
29
29
|
|
|
30
30
|
5: {
|
|
31
|
+
file: "@apollo/client/__cjs/utilities/internal/checkDocument.cjs",
|
|
32
|
+
message: '`%s` is a forbidden field alias name in the selection set for field `%s` in %s "%s".'
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
6: {
|
|
31
36
|
file: "@apollo/client/__cjs/utilities/internal/getFragmentDefinition.cjs",
|
|
32
37
|
condition: "doc.kind === \"Document\"",
|
|
33
38
|
|
|
@@ -35,73 +40,73 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
35
40
|
string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
36
41
|
},
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
7: {
|
|
39
44
|
file: "@apollo/client/__cjs/utilities/internal/getFragmentDefinition.cjs",
|
|
40
45
|
condition: "doc.definitions.length <= 1",
|
|
41
46
|
message: "Fragment must have exactly one definition."
|
|
42
47
|
},
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
8: {
|
|
45
50
|
file: "@apollo/client/__cjs/utilities/internal/getFragmentDefinition.cjs",
|
|
46
51
|
condition: "fragmentDef.kind === \"FragmentDefinition\"",
|
|
47
52
|
message: "Must be a fragment definition."
|
|
48
53
|
},
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
9: {
|
|
51
56
|
file: "@apollo/client/__cjs/utilities/internal/getFragmentFromSelection.cjs",
|
|
52
57
|
condition: "fragment",
|
|
53
58
|
message: `No fragment named %s`
|
|
54
59
|
},
|
|
55
60
|
|
|
56
|
-
|
|
61
|
+
10: {
|
|
57
62
|
file: "@apollo/client/__cjs/utilities/internal/getFragmentQueryDocument.cjs",
|
|
58
63
|
|
|
59
64
|
message: `Found a %s operation%s. ` +
|
|
60
65
|
"No operations are allowed when using a fragment as a query. Only fragments are allowed."
|
|
61
66
|
},
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
11: {
|
|
64
69
|
file: "@apollo/client/__cjs/utilities/internal/getFragmentQueryDocument.cjs",
|
|
65
70
|
condition: "fragments.length === 1",
|
|
66
71
|
message: `Found %s fragments. \`fragmentName\` must be provided when there is not exactly 1 fragment.`
|
|
67
72
|
},
|
|
68
73
|
|
|
69
|
-
|
|
74
|
+
12: {
|
|
70
75
|
file: "@apollo/client/__cjs/utilities/internal/getMainDefinition.cjs",
|
|
71
76
|
message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
|
|
72
77
|
},
|
|
73
78
|
|
|
74
|
-
|
|
79
|
+
13: {
|
|
75
80
|
file: "@apollo/client/__cjs/utilities/internal/getQueryDefinition.cjs",
|
|
76
81
|
condition: "queryDef && queryDef.operation === \"query\"",
|
|
77
82
|
message: "Must contain a query definition."
|
|
78
83
|
},
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
15: {
|
|
81
86
|
file: "@apollo/client/__cjs/utilities/internal/shouldInclude.cjs",
|
|
82
87
|
condition: "evaledValue !== void 0",
|
|
83
88
|
message: `Invalid variable referenced in @%s directive.`
|
|
84
89
|
},
|
|
85
90
|
|
|
86
|
-
|
|
91
|
+
16: {
|
|
87
92
|
file: "@apollo/client/__cjs/utilities/internal/shouldInclude.cjs",
|
|
88
93
|
condition: "directiveArguments && directiveArguments.length === 1",
|
|
89
94
|
message: `Incorrect number of arguments for the @%s directive.`
|
|
90
95
|
},
|
|
91
96
|
|
|
92
|
-
|
|
97
|
+
17: {
|
|
93
98
|
file: "@apollo/client/__cjs/utilities/internal/shouldInclude.cjs",
|
|
94
99
|
condition: "ifArgument.name && ifArgument.name.value === \"if\"",
|
|
95
100
|
message: `Invalid argument for the @%s directive.`
|
|
96
101
|
},
|
|
97
102
|
|
|
98
|
-
|
|
103
|
+
18: {
|
|
99
104
|
file: "@apollo/client/__cjs/utilities/internal/shouldInclude.cjs",
|
|
100
105
|
condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
|
|
101
106
|
message: `Argument for the @%s directive must be a variable or a boolean value.`
|
|
102
107
|
},
|
|
103
108
|
|
|
104
|
-
|
|
109
|
+
19: {
|
|
105
110
|
file: "@apollo/client/__cjs/utilities/internal/valueToObjectRepresentation.cjs",
|
|
106
111
|
|
|
107
112
|
message: `The inline argument "%s" of kind "%s"` +
|
|
@@ -109,37 +114,37 @@ string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`
|
|
|
109
114
|
"overcome this limitation."
|
|
110
115
|
},
|
|
111
116
|
|
|
112
|
-
|
|
117
|
+
20: {
|
|
113
118
|
file: "@apollo/client/__cjs/utilities/graphql/DocumentTransform.cjs",
|
|
114
119
|
condition: "Array.isArray(cacheKeys)",
|
|
115
120
|
message: "`getCacheKey` must return an array or undefined"
|
|
116
121
|
},
|
|
117
122
|
|
|
118
|
-
|
|
123
|
+
21: {
|
|
119
124
|
file: "@apollo/client/__cjs/testing/core/mocking/mockLink.cjs",
|
|
120
125
|
condition: "max > min",
|
|
121
126
|
message: "realisticDelay: `min` must be less than `max`"
|
|
122
127
|
},
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
22: {
|
|
125
130
|
file: "@apollo/client/__cjs/testing/core/mocking/mockLink.cjs",
|
|
126
131
|
condition: "queryWithoutClientOnlyDirectives",
|
|
127
132
|
message: "query is required"
|
|
128
133
|
},
|
|
129
134
|
|
|
130
|
-
|
|
135
|
+
23: {
|
|
131
136
|
file: "@apollo/client/__cjs/testing/core/mocking/mockLink.cjs",
|
|
132
137
|
condition: "serverQuery",
|
|
133
138
|
message: "Cannot mock a client-only query. Mocked responses should contain at least one non-client field."
|
|
134
139
|
},
|
|
135
140
|
|
|
136
|
-
|
|
141
|
+
24: {
|
|
137
142
|
file: "@apollo/client/__cjs/testing/core/mocking/mockLink.cjs",
|
|
138
143
|
condition: "(mock.maxUsageCount ?? 1) > 0",
|
|
139
144
|
message: "Mocked response `maxUsageCount` must be greater than 0. Given %s"
|
|
140
145
|
},
|
|
141
146
|
|
|
142
|
-
|
|
147
|
+
25: {
|
|
143
148
|
file: "@apollo/client/__cjs/react/ssr/prerenderStatic.cjs",
|
|
144
149
|
condition: "renderCount <= maxRerenders",
|
|
145
150
|
|
|
@@ -149,19 +154,19 @@ and need to increase the \`maxRerender\` option to \`prerenderStatic\`, or that
|
|
|
149
154
|
you have an infinite render loop in your application.`
|
|
150
155
|
},
|
|
151
156
|
|
|
152
|
-
|
|
157
|
+
26: {
|
|
153
158
|
file: "@apollo/client/__cjs/react/ssr/prerenderStatic.cjs",
|
|
154
159
|
condition: "!signal?.aborted",
|
|
155
160
|
message: "The operation was aborted before it could be attempted."
|
|
156
161
|
},
|
|
157
162
|
|
|
158
|
-
|
|
163
|
+
27: {
|
|
159
164
|
file: "@apollo/client/__cjs/react/internal/cache/QueryReference.cjs",
|
|
160
165
|
condition: "!queryRef || QUERY_REFERENCE_SYMBOL in queryRef",
|
|
161
166
|
message: "Expected a QueryRef object, but got something else instead."
|
|
162
167
|
},
|
|
163
168
|
|
|
164
|
-
|
|
169
|
+
28: {
|
|
165
170
|
file: "@apollo/client/__cjs/react/hooks/useApolloClient.cjs",
|
|
166
171
|
condition: "!!client",
|
|
167
172
|
|
|
@@ -170,43 +175,43 @@ you have an infinite render loop in your application.`
|
|
|
170
175
|
"instance in via options."
|
|
171
176
|
},
|
|
172
177
|
|
|
173
|
-
|
|
178
|
+
29: {
|
|
174
179
|
file: "@apollo/client/__cjs/react/hooks/useLazyQuery.cjs",
|
|
175
180
|
condition: "resultRef.current",
|
|
176
181
|
message: "useLazyQuery: '%s' cannot be called before executing the query."
|
|
177
182
|
},
|
|
178
183
|
|
|
179
|
-
|
|
184
|
+
30: {
|
|
180
185
|
file: "@apollo/client/__cjs/react/hooks/useLazyQuery.cjs",
|
|
181
186
|
condition: "!calledDuringRender()",
|
|
182
187
|
message: "useLazyQuery: 'execute' should not be called during render. To start a query during render, use the 'useQuery' hook."
|
|
183
188
|
},
|
|
184
189
|
|
|
185
|
-
|
|
190
|
+
31: {
|
|
186
191
|
file: "@apollo/client/__cjs/react/hooks/useLoadableQuery.cjs",
|
|
187
192
|
condition: "!calledDuringRender()",
|
|
188
193
|
message: "useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook."
|
|
189
194
|
},
|
|
190
195
|
|
|
191
|
-
|
|
196
|
+
32: {
|
|
192
197
|
file: "@apollo/client/__cjs/react/hooks/useLoadableQuery.cjs",
|
|
193
198
|
condition: "internalQueryRef",
|
|
194
199
|
message: "The query has not been loaded. Please load the query."
|
|
195
200
|
},
|
|
196
201
|
|
|
197
|
-
|
|
202
|
+
33: {
|
|
198
203
|
file: "@apollo/client/__cjs/react/hooks/useSubscription.cjs",
|
|
199
204
|
condition: "!optionsRef.current.skip",
|
|
200
205
|
message: "A subscription that is skipped cannot be restarted."
|
|
201
206
|
},
|
|
202
207
|
|
|
203
|
-
|
|
208
|
+
35: {
|
|
204
209
|
file: "@apollo/client/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs",
|
|
205
210
|
condition: "supportedFetchPolicies.includes(fetchPolicy)",
|
|
206
211
|
message: `The fetch policy \`%s\` is not supported with suspense.`
|
|
207
212
|
},
|
|
208
213
|
|
|
209
|
-
|
|
214
|
+
37: {
|
|
210
215
|
file: "@apollo/client/__cjs/react/context/ApolloConsumer.cjs",
|
|
211
216
|
condition: "context && context.client",
|
|
212
217
|
|
|
@@ -214,7 +219,7 @@ you have an infinite render loop in your application.`
|
|
|
214
219
|
"Wrap the root component in an <ApolloProvider>."
|
|
215
220
|
},
|
|
216
221
|
|
|
217
|
-
|
|
222
|
+
38: {
|
|
218
223
|
file: "@apollo/client/__cjs/react/context/ApolloContext.cjs",
|
|
219
224
|
condition: "\"createContext\" in React",
|
|
220
225
|
|
|
@@ -225,7 +230,7 @@ you have an infinite render loop in your application.`
|
|
|
225
230
|
"For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
|
|
226
231
|
},
|
|
227
232
|
|
|
228
|
-
|
|
233
|
+
39: {
|
|
229
234
|
file: "@apollo/client/__cjs/react/context/ApolloProvider.cjs",
|
|
230
235
|
condition: "context.client",
|
|
231
236
|
|
|
@@ -233,71 +238,71 @@ you have an infinite render loop in your application.`
|
|
|
233
238
|
'sure you pass in your client via the "client" prop.'
|
|
234
239
|
},
|
|
235
240
|
|
|
236
|
-
|
|
241
|
+
40: {
|
|
237
242
|
file: "@apollo/client/__cjs/masking/maskDefinition.cjs",
|
|
238
243
|
condition: "fragment",
|
|
239
244
|
message: "Could not find fragment with name '%s'."
|
|
240
245
|
},
|
|
241
246
|
|
|
242
|
-
|
|
247
|
+
42: {
|
|
243
248
|
file: "@apollo/client/__cjs/masking/maskFragment.cjs",
|
|
244
249
|
condition: "fragments.length === 1",
|
|
245
250
|
message: `Found %s fragments. \`fragmentName\` must be provided when there is not exactly 1 fragment.`
|
|
246
251
|
},
|
|
247
252
|
|
|
248
|
-
|
|
253
|
+
43: {
|
|
249
254
|
file: "@apollo/client/__cjs/masking/maskFragment.cjs",
|
|
250
255
|
condition: "!!fragment",
|
|
251
256
|
message: `Could not find fragment with name "%s".`
|
|
252
257
|
},
|
|
253
258
|
|
|
254
|
-
|
|
259
|
+
44: {
|
|
255
260
|
file: "@apollo/client/__cjs/masking/maskOperation.cjs",
|
|
256
261
|
condition: "definition",
|
|
257
262
|
message: "Expected a parsed GraphQL document with a query, mutation, or subscription."
|
|
258
263
|
},
|
|
259
264
|
|
|
260
|
-
|
|
265
|
+
48: {
|
|
261
266
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
262
267
|
condition: "(0, internal_1.hasDirectives)([\"client\"], document)",
|
|
263
268
|
message: "Expected document to contain `@client` fields."
|
|
264
269
|
},
|
|
265
270
|
|
|
266
|
-
|
|
271
|
+
49: {
|
|
267
272
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
268
273
|
condition: "(0, internal_1.hasDirectives)([\"client\"], document)",
|
|
269
274
|
message: "Expected document to contain `@client` fields."
|
|
270
275
|
},
|
|
271
276
|
|
|
272
|
-
|
|
277
|
+
50: {
|
|
273
278
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
274
279
|
condition: "fragment",
|
|
275
280
|
message: "No fragment named %s"
|
|
276
281
|
},
|
|
277
282
|
|
|
278
|
-
|
|
283
|
+
55: {
|
|
279
284
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
280
285
|
message: "Could not resolve __typename on object %o returned from resolver '%s'. '__typename' needs to be returned to properly resolve child fields."
|
|
281
286
|
},
|
|
282
287
|
|
|
283
|
-
|
|
288
|
+
56: {
|
|
284
289
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
285
290
|
condition: "fragment",
|
|
286
291
|
message: `No fragment named %s`
|
|
287
292
|
},
|
|
288
293
|
|
|
289
|
-
|
|
294
|
+
57: {
|
|
290
295
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
291
296
|
condition: "cache.fragmentMatches",
|
|
292
297
|
message: "The configured cache does not support fragment matching which will lead to incorrect results when executing local resolvers. Please use a cache that implements `fragmetMatches`."
|
|
293
298
|
},
|
|
294
299
|
|
|
295
|
-
|
|
300
|
+
58: {
|
|
296
301
|
file: "@apollo/client/__cjs/link/utils/validateOperation.cjs",
|
|
297
302
|
message: `illegal argument: %s`
|
|
298
303
|
},
|
|
299
304
|
|
|
300
|
-
|
|
305
|
+
59: {
|
|
301
306
|
file: "@apollo/client/__cjs/link/persisted-queries/index.cjs",
|
|
302
307
|
condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
|
|
303
308
|
|
|
@@ -306,13 +311,13 @@ you have an infinite render loop in your application.`
|
|
|
306
311
|
"parameter."
|
|
307
312
|
},
|
|
308
313
|
|
|
309
|
-
|
|
314
|
+
60: {
|
|
310
315
|
file: "@apollo/client/__cjs/link/persisted-queries/index.cjs",
|
|
311
316
|
condition: "forward",
|
|
312
317
|
message: "PersistedQueryLink cannot be the last link in the chain."
|
|
313
318
|
},
|
|
314
319
|
|
|
315
|
-
|
|
320
|
+
61: {
|
|
316
321
|
file: "@apollo/client/__cjs/link/http/checkFetcher.cjs",
|
|
317
322
|
condition: "fetcher || typeof fetch !== \"undefined\"",
|
|
318
323
|
|
|
@@ -415,33 +420,33 @@ const client = new ApolloClient({
|
|
|
415
420
|
message: "notifyOnNetworkStatusChange option only supported on watchQuery."
|
|
416
421
|
},
|
|
417
422
|
|
|
418
|
-
|
|
423
|
+
75: {
|
|
424
|
+
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
425
|
+
condition: "optionsWithDefaults.mutation",
|
|
426
|
+
message: "The `mutation` option is required. Please provide a GraphQL document in the `mutation` option."
|
|
427
|
+
},
|
|
428
|
+
|
|
429
|
+
76: {
|
|
430
|
+
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
431
|
+
condition: "optionsWithDefaults.fetchPolicy === \"network-only\" ||\n optionsWithDefaults.fetchPolicy === \"no-cache\"",
|
|
432
|
+
message: "Mutations only support 'network-only' or 'no-cache' fetch policies. The default 'network-only' behavior automatically writes mutation results to the cache. Passing 'no-cache' skips the cache write."
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
79: {
|
|
419
436
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
420
437
|
condition: "updateQuery",
|
|
421
438
|
message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
|
|
422
439
|
},
|
|
423
440
|
|
|
424
|
-
|
|
441
|
+
81: {
|
|
425
442
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
426
443
|
condition: "pollInterval",
|
|
427
444
|
message: "Attempted to start a polling query without a polling interval."
|
|
428
445
|
},
|
|
429
446
|
|
|
430
|
-
81: {
|
|
431
|
-
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
432
|
-
message: "QueryManager stopped while query was in flight"
|
|
433
|
-
},
|
|
434
|
-
|
|
435
|
-
82: {
|
|
436
|
-
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
437
|
-
condition: "mutation",
|
|
438
|
-
message: "mutation option is required. You must specify your GraphQL document in the mutation option."
|
|
439
|
-
},
|
|
440
|
-
|
|
441
447
|
83: {
|
|
442
448
|
file: "@apollo/client/__cjs/core/QueryManager.cjs",
|
|
443
|
-
|
|
444
|
-
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."
|
|
449
|
+
message: "QueryManager stopped while query was in flight"
|
|
445
450
|
},
|
|
446
451
|
|
|
447
452
|
84: {
|
|
@@ -531,12 +536,12 @@ const client = new ApolloClient({
|
|
|
531
536
|
};
|
|
532
537
|
|
|
533
538
|
export const devDebug = {
|
|
534
|
-
|
|
539
|
+
77: {
|
|
535
540
|
file: "@apollo/client/__cjs/core/ApolloClient.cjs",
|
|
536
541
|
message: `In client.refetchQueries, Promise.all promise rejected with error %o`
|
|
537
542
|
},
|
|
538
543
|
|
|
539
|
-
|
|
544
|
+
82: {
|
|
540
545
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
541
546
|
message: `Missing cache result fields: %o`
|
|
542
547
|
}
|
|
@@ -545,62 +550,57 @@ export const devDebug = {
|
|
|
545
550
|
export const devLog = {};
|
|
546
551
|
|
|
547
552
|
export const devWarn = {
|
|
548
|
-
|
|
553
|
+
36: {
|
|
549
554
|
file: "@apollo/client/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs",
|
|
550
555
|
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."
|
|
551
556
|
},
|
|
552
557
|
|
|
553
|
-
|
|
558
|
+
41: {
|
|
554
559
|
file: "@apollo/client/__cjs/masking/maskDefinition.cjs",
|
|
555
560
|
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."
|
|
556
561
|
},
|
|
557
562
|
|
|
558
|
-
|
|
563
|
+
45: {
|
|
559
564
|
file: "@apollo/client/__cjs/masking/utils.cjs",
|
|
560
565
|
message: "@unmask 'mode' argument does not support variables."
|
|
561
566
|
},
|
|
562
567
|
|
|
563
|
-
|
|
568
|
+
46: {
|
|
564
569
|
file: "@apollo/client/__cjs/masking/utils.cjs",
|
|
565
570
|
message: "@unmask 'mode' argument must be of type string."
|
|
566
571
|
},
|
|
567
572
|
|
|
568
|
-
|
|
573
|
+
47: {
|
|
569
574
|
file: "@apollo/client/__cjs/masking/utils.cjs",
|
|
570
575
|
message: "@unmask 'mode' argument does not recognize value '%s'."
|
|
571
576
|
},
|
|
572
577
|
|
|
573
|
-
|
|
578
|
+
51: {
|
|
574
579
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
575
580
|
message: "Could not find a resolver for the '%s' field. The field value has been set to `null`."
|
|
576
581
|
},
|
|
577
582
|
|
|
578
|
-
|
|
583
|
+
52: {
|
|
579
584
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
580
585
|
message: "The '%s' resolver returned `undefined` instead of a value. This is likely a bug in the resolver. If you didn't mean to return a value, return `null` instead."
|
|
581
586
|
},
|
|
582
587
|
|
|
583
|
-
|
|
588
|
+
53: {
|
|
584
589
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
585
590
|
message: "The '%s' field had no cached value and only forced resolvers were run. The value was set to `null`."
|
|
586
591
|
},
|
|
587
592
|
|
|
588
|
-
|
|
593
|
+
54: {
|
|
589
594
|
file: "@apollo/client/__cjs/local-state/LocalState.cjs",
|
|
590
595
|
message: "The '%s' field on object %o returned `undefined` instead of a value. The parent resolver did not include the property in the returned value and there was no resolver defined for the field."
|
|
591
596
|
},
|
|
592
597
|
|
|
593
|
-
61: {
|
|
594
|
-
file: "@apollo/client/__cjs/link/http/createHttpLink.cjs",
|
|
595
|
-
message: "Multipart-subscriptions do not support @defer"
|
|
596
|
-
},
|
|
597
|
-
|
|
598
598
|
64: {
|
|
599
599
|
file: "@apollo/client/__cjs/link/core/ApolloLink.cjs",
|
|
600
600
|
message: `You are calling concat on a terminating link, which will have no effect %o`
|
|
601
601
|
},
|
|
602
602
|
|
|
603
|
-
|
|
603
|
+
78: {
|
|
604
604
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
605
605
|
|
|
606
606
|
message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
|
|
@@ -673,17 +673,17 @@ For more information about these options, please refer to the documentation:
|
|
|
673
673
|
};
|
|
674
674
|
|
|
675
675
|
export const devError = {
|
|
676
|
-
|
|
676
|
+
14: {
|
|
677
677
|
file: "@apollo/client/__cjs/utilities/internal/removeDirectivesFromDocument.cjs",
|
|
678
678
|
message: `Could not find operation or fragment`
|
|
679
679
|
},
|
|
680
680
|
|
|
681
|
-
|
|
681
|
+
34: {
|
|
682
682
|
file: "@apollo/client/__cjs/react/hooks/useSyncExternalStore.cjs",
|
|
683
683
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
684
684
|
},
|
|
685
685
|
|
|
686
|
-
|
|
686
|
+
80: {
|
|
687
687
|
file: "@apollo/client/__cjs/core/ObservableQuery.cjs",
|
|
688
688
|
message: "Unhandled GraphQL subscription error"
|
|
689
689
|
},
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BatchHttpLink = void 0;
|
|
3
|
+
exports.BaseBatchHttpLink = exports.BatchHttpLink = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const link_1 = require("@apollo/client/link");
|
|
6
6
|
const batch_1 = require("@apollo/client/link/batch");
|
|
7
|
+
const client_awareness_1 = require("@apollo/client/link/client-awareness");
|
|
7
8
|
const http_1 = require("@apollo/client/link/http");
|
|
8
9
|
const environment_1 = require("@apollo/client/utilities/environment");
|
|
10
|
+
const internal_1 = require("@apollo/client/utilities/internal");
|
|
9
11
|
const globals_1 = require("@apollo/client/utilities/internal/globals");
|
|
10
12
|
const filterOperationVariables_js_1 = require("../utils/filterOperationVariables.cjs");
|
|
11
13
|
const backupFetch = (0, globals_1.maybe)(() => fetch);
|
|
@@ -14,6 +16,14 @@ const backupFetch = (0, globals_1.maybe)(() => fetch);
|
|
|
14
16
|
* context can include the headers property, which will be passed to the fetch function
|
|
15
17
|
*/
|
|
16
18
|
class BatchHttpLink extends link_1.ApolloLink {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
const { left, right, request } = link_1.ApolloLink.concat(new client_awareness_1.ClientAwarenessLink(options), new BaseBatchHttpLink(options));
|
|
21
|
+
super(request);
|
|
22
|
+
Object.assign(this, { left, right });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.BatchHttpLink = BatchHttpLink;
|
|
26
|
+
class BaseBatchHttpLink extends link_1.ApolloLink {
|
|
17
27
|
batchDebounce;
|
|
18
28
|
batchInterval;
|
|
19
29
|
batchMax;
|
|
@@ -29,7 +39,7 @@ class BatchHttpLink extends link_1.ApolloLink {
|
|
|
29
39
|
(0, http_1.checkFetcher)(preferredFetch || backupFetch);
|
|
30
40
|
}
|
|
31
41
|
const linkConfig = {
|
|
32
|
-
http: { includeExtensions, preserveHeaderCase },
|
|
42
|
+
http: (0, internal_1.compact)({ includeExtensions, preserveHeaderCase }),
|
|
33
43
|
options: requestOptions.fetchOptions,
|
|
34
44
|
credentials: requestOptions.credentials,
|
|
35
45
|
headers: requestOptions.headers,
|
|
@@ -40,21 +50,11 @@ class BatchHttpLink extends link_1.ApolloLink {
|
|
|
40
50
|
const batchHandler = (operations) => {
|
|
41
51
|
const chosenURI = (0, http_1.selectURI)(operations[0], uri);
|
|
42
52
|
const context = operations[0].getContext();
|
|
43
|
-
const clientAwarenessHeaders = {};
|
|
44
|
-
if (context.clientAwareness) {
|
|
45
|
-
const { name, version } = context.clientAwareness;
|
|
46
|
-
if (name) {
|
|
47
|
-
clientAwarenessHeaders["apollographql-client-name"] = name;
|
|
48
|
-
}
|
|
49
|
-
if (version) {
|
|
50
|
-
clientAwarenessHeaders["apollographql-client-version"] = version;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
53
|
const contextConfig = {
|
|
54
54
|
http: context.http,
|
|
55
55
|
options: context.fetchOptions,
|
|
56
56
|
credentials: context.credentials,
|
|
57
|
-
headers:
|
|
57
|
+
headers: context.headers,
|
|
58
58
|
};
|
|
59
59
|
//uses fallback, link, and then context to build options
|
|
60
60
|
const optsAndBody = operations.map((operation) => {
|
|
@@ -140,5 +140,5 @@ class BatchHttpLink extends link_1.ApolloLink {
|
|
|
140
140
|
return this.batcher.request(operation);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
exports.
|
|
143
|
+
exports.BaseBatchHttpLink = BaseBatchHttpLink;
|
|
144
144
|
//# sourceMappingURL=batchHttpLink.cjs.map
|