@apollo/client 4.0.0-alpha.20 → 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.
Files changed (214) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/__cjs/cache/core/cache.cjs +1 -1
  3. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  4. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  5. package/__cjs/cache/inmemory/policies.cjs +4 -4
  6. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  7. package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
  8. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  9. package/__cjs/core/ApolloClient.cjs +22 -19
  10. package/__cjs/core/ApolloClient.cjs.map +1 -1
  11. package/__cjs/core/ApolloClient.d.cts +7 -8
  12. package/__cjs/core/ObservableQuery.cjs +15 -11
  13. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  14. package/__cjs/core/ObservableQuery.d.cts +1 -2
  15. package/__cjs/core/QueryInfo.cjs +223 -34
  16. package/__cjs/core/QueryInfo.cjs.map +1 -1
  17. package/__cjs/core/QueryInfo.d.cts +34 -24
  18. package/__cjs/core/QueryManager.cjs +89 -265
  19. package/__cjs/core/QueryManager.cjs.map +1 -1
  20. package/__cjs/core/QueryManager.d.cts +13 -38
  21. package/__cjs/core/index.cjs.map +1 -1
  22. package/__cjs/core/index.d.cts +1 -1
  23. package/__cjs/core/networkStatus.cjs +7 -1
  24. package/__cjs/core/networkStatus.cjs.map +1 -1
  25. package/__cjs/core/networkStatus.d.cts +7 -1
  26. package/__cjs/core/types.d.cts +5 -4
  27. package/__cjs/invariantErrorCodes.cjs +99 -104
  28. package/__cjs/link/batch-http/batchHttpLink.cjs +14 -14
  29. package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
  30. package/__cjs/link/batch-http/batchHttpLink.d.cts +4 -0
  31. package/__cjs/link/batch-http/index.cjs +2 -1
  32. package/__cjs/link/batch-http/index.cjs.map +1 -1
  33. package/__cjs/link/batch-http/index.d.cts +1 -1
  34. package/__cjs/link/client-awareness/ClientAwarenessLink.cjs +45 -0
  35. package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -0
  36. package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +62 -0
  37. package/__cjs/link/client-awareness/index.cjs +6 -0
  38. package/__cjs/link/client-awareness/index.cjs.map +1 -0
  39. package/__cjs/link/client-awareness/index.d.cts +2 -0
  40. package/__cjs/link/core/ApolloLink.cjs +2 -2
  41. package/__cjs/link/core/types.d.cts +1 -6
  42. package/__cjs/link/http/BaseHttpLink.cjs +117 -0
  43. package/__cjs/link/http/BaseHttpLink.cjs.map +1 -0
  44. package/__cjs/link/http/BaseHttpLink.d.cts +6 -0
  45. package/__cjs/link/http/HttpLink.cjs +8 -5
  46. package/__cjs/link/http/HttpLink.cjs.map +1 -1
  47. package/__cjs/link/http/HttpLink.d.cts +16 -4
  48. package/__cjs/link/http/index.cjs +4 -3
  49. package/__cjs/link/http/index.cjs.map +1 -1
  50. package/__cjs/link/http/index.d.cts +2 -2
  51. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  52. package/__cjs/link/http/selectHttpOptionsAndBody.cjs +6 -5
  53. package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
  54. package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
  55. package/__cjs/link/persisted-queries/index.cjs +7 -5
  56. package/__cjs/link/persisted-queries/index.cjs.map +1 -1
  57. package/__cjs/local-state/LocalState.cjs +0 -8
  58. package/__cjs/local-state/LocalState.cjs.map +1 -1
  59. package/__cjs/masking/maskDefinition.cjs +2 -2
  60. package/__cjs/masking/maskDefinition.cjs.map +1 -1
  61. package/__cjs/masking/maskFragment.cjs +2 -10
  62. package/__cjs/masking/maskFragment.cjs.map +1 -1
  63. package/__cjs/masking/maskOperation.cjs +1 -9
  64. package/__cjs/masking/maskOperation.cjs.map +1 -1
  65. package/__cjs/masking/utils.cjs +0 -8
  66. package/__cjs/masking/utils.cjs.map +1 -1
  67. package/__cjs/masking/utils.d.cts +0 -1
  68. package/__cjs/react/context/ApolloConsumer.cjs +1 -1
  69. package/__cjs/react/context/ApolloContext.cjs +1 -1
  70. package/__cjs/react/context/ApolloProvider.cjs +1 -1
  71. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
  72. package/__cjs/react/hooks/useApolloClient.cjs +1 -1
  73. package/__cjs/react/hooks/useLazyQuery.cjs +3 -4
  74. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  75. package/__cjs/react/hooks/useLazyQuery.d.cts +0 -8
  76. package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
  77. package/__cjs/react/hooks/useSubscription.cjs +1 -1
  78. package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
  79. package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
  80. package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
  81. package/__cjs/testing/core/mocking/mockLink.cjs +4 -4
  82. package/__cjs/utilities/caching/sizes.cjs.map +1 -1
  83. package/__cjs/utilities/caching/sizes.d.cts +6 -0
  84. package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
  85. package/__cjs/utilities/index.cjs +1 -16
  86. package/__cjs/utilities/index.cjs.map +1 -1
  87. package/__cjs/utilities/index.d.cts +0 -13
  88. package/__cjs/utilities/internal/checkDocument.cjs +47 -13
  89. package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
  90. package/__cjs/utilities/internal/checkDocument.d.cts +1 -1
  91. package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
  92. package/__cjs/utilities/internal/getFragmentFromSelection.cjs +1 -1
  93. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +2 -2
  94. package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
  95. package/__cjs/utilities/internal/getMemoryInternals.cjs +1 -0
  96. package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
  97. package/__cjs/utilities/internal/getMemoryInternals.d.cts +0 -1
  98. package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
  99. package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +1 -1
  100. package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
  101. package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
  102. package/__cjs/version.cjs +1 -1
  103. package/cache/core/cache.js +1 -1
  104. package/cache/inmemory/entityStore.js +3 -3
  105. package/cache/inmemory/key-extractor.js +1 -1
  106. package/cache/inmemory/policies.js +4 -4
  107. package/cache/inmemory/policies.js.map +1 -1
  108. package/cache/inmemory/readFromStore.js +2 -2
  109. package/cache/inmemory/writeToStore.js +4 -4
  110. package/core/ApolloClient.d.ts +7 -8
  111. package/core/ApolloClient.js +23 -20
  112. package/core/ApolloClient.js.map +1 -1
  113. package/core/ObservableQuery.d.ts +1 -2
  114. package/core/ObservableQuery.js +15 -11
  115. package/core/ObservableQuery.js.map +1 -1
  116. package/core/QueryInfo.d.ts +34 -24
  117. package/core/QueryInfo.js +221 -34
  118. package/core/QueryInfo.js.map +1 -1
  119. package/core/QueryManager.d.ts +13 -38
  120. package/core/QueryManager.js +91 -267
  121. package/core/QueryManager.js.map +1 -1
  122. package/core/index.d.ts +1 -1
  123. package/core/index.js.map +1 -1
  124. package/core/networkStatus.d.ts +7 -1
  125. package/core/networkStatus.js +7 -1
  126. package/core/networkStatus.js.map +1 -1
  127. package/core/types.d.ts +5 -4
  128. package/invariantErrorCodes.js +99 -104
  129. package/legacyEntryPoints/link/client-awareness/client-awareness.cjs +1 -0
  130. package/legacyEntryPoints/link/client-awareness/client-awareness.d.cts +1 -0
  131. package/legacyEntryPoints/link/client-awareness/index.d.ts +1 -0
  132. package/legacyEntryPoints/link/client-awareness/index.js +1 -0
  133. package/link/batch-http/batchHttpLink.d.ts +4 -0
  134. package/link/batch-http/batchHttpLink.js +11 -12
  135. package/link/batch-http/batchHttpLink.js.map +1 -1
  136. package/link/batch-http/index.d.ts +1 -1
  137. package/link/batch-http/index.js +1 -1
  138. package/link/batch-http/index.js.map +1 -1
  139. package/link/client-awareness/ClientAwarenessLink.d.ts +62 -0
  140. package/link/client-awareness/ClientAwarenessLink.js +41 -0
  141. package/link/client-awareness/ClientAwarenessLink.js.map +1 -0
  142. package/link/client-awareness/index.d.ts +2 -0
  143. package/link/client-awareness/index.js +2 -0
  144. package/link/client-awareness/index.js.map +1 -0
  145. package/link/core/ApolloLink.js +2 -2
  146. package/link/core/types.d.ts +1 -6
  147. package/link/http/BaseHttpLink.d.ts +6 -0
  148. package/link/http/BaseHttpLink.js +113 -0
  149. package/link/http/BaseHttpLink.js.map +1 -0
  150. package/link/http/HttpLink.d.ts +16 -4
  151. package/link/http/HttpLink.js +6 -4
  152. package/link/http/HttpLink.js.map +1 -1
  153. package/link/http/index.d.ts +2 -2
  154. package/link/http/index.js +2 -2
  155. package/link/http/index.js.map +1 -1
  156. package/link/http/parseAndCheckHttpResponse.js +1 -1
  157. package/link/http/selectHttpOptionsAndBody.js +6 -5
  158. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  159. package/link/http/serializeFetchParameter.js +1 -1
  160. package/link/persisted-queries/index.js +7 -5
  161. package/link/persisted-queries/index.js.map +1 -1
  162. package/local-state/LocalState.js +0 -8
  163. package/local-state/LocalState.js.map +1 -1
  164. package/masking/maskDefinition.js +2 -2
  165. package/masking/maskDefinition.js.map +1 -1
  166. package/masking/maskFragment.js +2 -10
  167. package/masking/maskFragment.js.map +1 -1
  168. package/masking/maskOperation.js +1 -9
  169. package/masking/maskOperation.js.map +1 -1
  170. package/masking/utils.d.ts +0 -1
  171. package/masking/utils.js +0 -7
  172. package/masking/utils.js.map +1 -1
  173. package/package.json +7 -1
  174. package/react/context/ApolloConsumer.js +1 -1
  175. package/react/context/ApolloContext.js +1 -1
  176. package/react/context/ApolloProvider.js +1 -1
  177. package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
  178. package/react/hooks/useApolloClient.js +1 -1
  179. package/react/hooks/useLazyQuery.d.ts +0 -8
  180. package/react/hooks/useLazyQuery.js +3 -4
  181. package/react/hooks/useLazyQuery.js.map +1 -1
  182. package/react/hooks/useLoadableQuery.js +2 -2
  183. package/react/hooks/useSubscription.js +1 -1
  184. package/react/hooks/useSyncExternalStore.js +1 -1
  185. package/react/internal/cache/QueryReference.js +1 -1
  186. package/react/ssr/prerenderStatic.js +2 -2
  187. package/testing/core/mocking/mockLink.js +4 -4
  188. package/utilities/caching/sizes.d.ts +6 -0
  189. package/utilities/caching/sizes.js.map +1 -1
  190. package/utilities/graphql/DocumentTransform.js +1 -1
  191. package/utilities/index.d.ts +0 -13
  192. package/utilities/index.js +0 -12
  193. package/utilities/index.js.map +1 -1
  194. package/utilities/internal/checkDocument.d.ts +1 -1
  195. package/utilities/internal/checkDocument.js +46 -12
  196. package/utilities/internal/checkDocument.js.map +1 -1
  197. package/utilities/internal/getFragmentDefinition.js +3 -3
  198. package/utilities/internal/getFragmentFromSelection.js +1 -1
  199. package/utilities/internal/getFragmentQueryDocument.js +2 -2
  200. package/utilities/internal/getMainDefinition.js +1 -1
  201. package/utilities/internal/getMemoryInternals.d.ts +0 -1
  202. package/utilities/internal/getMemoryInternals.js +1 -0
  203. package/utilities/internal/getMemoryInternals.js.map +1 -1
  204. package/utilities/internal/getQueryDefinition.js +1 -1
  205. package/utilities/internal/removeDirectivesFromDocument.js +1 -1
  206. package/utilities/internal/shouldInclude.js +4 -4
  207. package/utilities/internal/valueToObjectRepresentation.js +1 -1
  208. package/version.js +1 -1
  209. package/__cjs/link/http/createHttpLink.cjs +0 -151
  210. package/__cjs/link/http/createHttpLink.cjs.map +0 -1
  211. package/__cjs/link/http/createHttpLink.d.cts +0 -4
  212. package/link/http/createHttpLink.d.ts +0 -4
  213. package/link/http/createHttpLink.js +0 -143
  214. 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/utilities/internal/checkDocument.js",
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/utilities/internal/getFragmentDefinition.js",
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
- 6: {
43
+ 7: {
39
44
  file: "@apollo/client/utilities/internal/getFragmentDefinition.js",
40
45
  condition: "doc.definitions.length <= 1",
41
46
  message: "Fragment must have exactly one definition."
42
47
  },
43
48
 
44
- 7: {
49
+ 8: {
45
50
  file: "@apollo/client/utilities/internal/getFragmentDefinition.js",
46
51
  condition: "fragmentDef.kind === \"FragmentDefinition\"",
47
52
  message: "Must be a fragment definition."
48
53
  },
49
54
 
50
- 8: {
55
+ 9: {
51
56
  file: "@apollo/client/utilities/internal/getFragmentFromSelection.js",
52
57
  condition: "fragment",
53
58
  message: `No fragment named %s`
54
59
  },
55
60
 
56
- 9: {
61
+ 10: {
57
62
  file: "@apollo/client/utilities/internal/getFragmentQueryDocument.js",
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
- 10: {
68
+ 11: {
64
69
  file: "@apollo/client/utilities/internal/getFragmentQueryDocument.js",
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
- 11: {
74
+ 12: {
70
75
  file: "@apollo/client/utilities/internal/getMainDefinition.js",
71
76
  message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
72
77
  },
73
78
 
74
- 12: {
79
+ 13: {
75
80
  file: "@apollo/client/utilities/internal/getQueryDefinition.js",
76
81
  condition: "queryDef && queryDef.operation === \"query\"",
77
82
  message: "Must contain a query definition."
78
83
  },
79
84
 
80
- 14: {
85
+ 15: {
81
86
  file: "@apollo/client/utilities/internal/shouldInclude.js",
82
87
  condition: "evaledValue !== void 0",
83
88
  message: `Invalid variable referenced in @%s directive.`
84
89
  },
85
90
 
86
- 15: {
91
+ 16: {
87
92
  file: "@apollo/client/utilities/internal/shouldInclude.js",
88
93
  condition: "directiveArguments && directiveArguments.length === 1",
89
94
  message: `Incorrect number of arguments for the @%s directive.`
90
95
  },
91
96
 
92
- 16: {
97
+ 17: {
93
98
  file: "@apollo/client/utilities/internal/shouldInclude.js",
94
99
  condition: "ifArgument.name && ifArgument.name.value === \"if\"",
95
100
  message: `Invalid argument for the @%s directive.`
96
101
  },
97
102
 
98
- 17: {
103
+ 18: {
99
104
  file: "@apollo/client/utilities/internal/shouldInclude.js",
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
- 18: {
109
+ 19: {
105
110
  file: "@apollo/client/utilities/internal/valueToObjectRepresentation.js",
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
- 19: {
117
+ 20: {
113
118
  file: "@apollo/client/utilities/graphql/DocumentTransform.js",
114
119
  condition: "Array.isArray(cacheKeys)",
115
120
  message: "`getCacheKey` must return an array or undefined"
116
121
  },
117
122
 
118
- 20: {
123
+ 21: {
119
124
  file: "@apollo/client/testing/core/mocking/mockLink.js",
120
125
  condition: "max > min",
121
126
  message: "realisticDelay: `min` must be less than `max`"
122
127
  },
123
128
 
124
- 21: {
129
+ 22: {
125
130
  file: "@apollo/client/testing/core/mocking/mockLink.js",
126
131
  condition: "queryWithoutClientOnlyDirectives",
127
132
  message: "query is required"
128
133
  },
129
134
 
130
- 22: {
135
+ 23: {
131
136
  file: "@apollo/client/testing/core/mocking/mockLink.js",
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
- 23: {
141
+ 24: {
137
142
  file: "@apollo/client/testing/core/mocking/mockLink.js",
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
- 24: {
147
+ 25: {
143
148
  file: "@apollo/client/react/ssr/prerenderStatic.js",
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
- 25: {
157
+ 26: {
153
158
  file: "@apollo/client/react/ssr/prerenderStatic.js",
154
159
  condition: "!signal?.aborted",
155
160
  message: "The operation was aborted before it could be attempted."
156
161
  },
157
162
 
158
- 26: {
163
+ 27: {
159
164
  file: "@apollo/client/react/internal/cache/QueryReference.js",
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
- 27: {
169
+ 28: {
165
170
  file: "@apollo/client/react/hooks/useApolloClient.js",
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
- 28: {
178
+ 29: {
174
179
  file: "@apollo/client/react/hooks/useLazyQuery.js",
175
180
  condition: "resultRef.current",
176
181
  message: "useLazyQuery: '%s' cannot be called before executing the query."
177
182
  },
178
183
 
179
- 29: {
184
+ 30: {
180
185
  file: "@apollo/client/react/hooks/useLazyQuery.js",
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
- 30: {
190
+ 31: {
186
191
  file: "@apollo/client/react/hooks/useLoadableQuery.js",
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
- 31: {
196
+ 32: {
192
197
  file: "@apollo/client/react/hooks/useLoadableQuery.js",
193
198
  condition: "internalQueryRef",
194
199
  message: "The query has not been loaded. Please load the query."
195
200
  },
196
201
 
197
- 32: {
202
+ 33: {
198
203
  file: "@apollo/client/react/hooks/useSubscription.js",
199
204
  condition: "!optionsRef.current.skip",
200
205
  message: "A subscription that is skipped cannot be restarted."
201
206
  },
202
207
 
203
- 34: {
208
+ 35: {
204
209
  file: "@apollo/client/react/hooks/internal/validateSuspenseHookOptions.js",
205
210
  condition: "supportedFetchPolicies.includes(fetchPolicy)",
206
211
  message: `The fetch policy \`%s\` is not supported with suspense.`
207
212
  },
208
213
 
209
- 36: {
214
+ 37: {
210
215
  file: "@apollo/client/react/context/ApolloConsumer.js",
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
- 37: {
222
+ 38: {
218
223
  file: "@apollo/client/react/context/ApolloContext.js",
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
- 38: {
233
+ 39: {
229
234
  file: "@apollo/client/react/context/ApolloProvider.js",
230
235
  condition: "context.client",
231
236
 
@@ -233,25 +238,25 @@ 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
- 39: {
241
+ 40: {
237
242
  file: "@apollo/client/masking/maskDefinition.js",
238
243
  condition: "fragment",
239
244
  message: "Could not find fragment with name '%s'."
240
245
  },
241
246
 
242
- 41: {
247
+ 42: {
243
248
  file: "@apollo/client/masking/maskFragment.js",
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
- 42: {
253
+ 43: {
249
254
  file: "@apollo/client/masking/maskFragment.js",
250
255
  condition: "!!fragment",
251
256
  message: `Could not find fragment with name "%s".`
252
257
  },
253
258
 
254
- 43: {
259
+ 44: {
255
260
  file: "@apollo/client/masking/maskOperation.js",
256
261
  condition: "definition",
257
262
  message: "Expected a parsed GraphQL document with a query, mutation, or subscription."
@@ -330,23 +335,23 @@ const client = new ApolloClient({
330
335
  `
331
336
  },
332
337
 
333
- 63: {
338
+ 62: {
334
339
  file: "@apollo/client/link/http/parseAndCheckHttpResponse.js",
335
340
  condition: "response.body && typeof response.body.getReader === \"function\"",
336
341
  message: "Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`."
337
342
  },
338
343
 
339
- 64: {
344
+ 63: {
340
345
  file: "@apollo/client/link/http/serializeFetchParameter.js",
341
346
  message: `Network request failed. %s is not serializable: %s`
342
347
  },
343
348
 
344
- 66: {
349
+ 65: {
345
350
  file: "@apollo/client/link/core/ApolloLink.js",
346
351
  message: "request is not implemented"
347
352
  },
348
353
 
349
- 67: {
354
+ 66: {
350
355
  file: "@apollo/client/core/ApolloClient.js",
351
356
  condition: "options.cache",
352
357
 
@@ -355,7 +360,7 @@ const client = new ApolloClient({
355
360
  "For more information, please visit: https://go.apollo.dev/c/docs"
356
361
  },
357
362
 
358
- 68: {
363
+ 67: {
359
364
  file: "@apollo/client/core/ApolloClient.js",
360
365
  condition: "options.link",
361
366
 
@@ -364,7 +369,7 @@ const client = new ApolloClient({
364
369
  "For more information, please visit: https://go.apollo.dev/c/docs"
365
370
  },
366
371
 
367
- 69: {
372
+ 68: {
368
373
  file: "@apollo/client/core/ApolloClient.js",
369
374
  condition: "options.fetchPolicy !== \"cache-and-network\"",
370
375
 
@@ -374,7 +379,7 @@ const client = new ApolloClient({
374
379
  "using a different fetchPolicy, such as cache-first or network-only."
375
380
  },
376
381
 
377
- 70: {
382
+ 69: {
378
383
  file: "@apollo/client/core/ApolloClient.js",
379
384
  condition: "options.fetchPolicy !== \"standby\"",
380
385
 
@@ -383,7 +388,7 @@ const client = new ApolloClient({
383
388
  "as cache-first or network-only."
384
389
  },
385
390
 
386
- 71: {
391
+ 70: {
387
392
  file: "@apollo/client/core/ApolloClient.js",
388
393
  condition: "options.query",
389
394
 
@@ -391,152 +396,152 @@ const client = new ApolloClient({
391
396
  "in the query option."
392
397
  },
393
398
 
394
- 72: {
399
+ 71: {
395
400
  file: "@apollo/client/core/ApolloClient.js",
396
401
  condition: "options.query.kind === \"Document\"",
397
402
  message: 'You must wrap the query string in a "gql" tag.'
398
403
  },
399
404
 
400
- 73: {
405
+ 72: {
401
406
  file: "@apollo/client/core/ApolloClient.js",
402
407
  condition: "!options.returnPartialData",
403
408
  message: "returnPartialData option only supported on watchQuery."
404
409
  },
405
410
 
406
- 74: {
411
+ 73: {
407
412
  file: "@apollo/client/core/ApolloClient.js",
408
413
  condition: "!options.pollInterval",
409
414
  message: "pollInterval option only supported on watchQuery."
410
415
  },
411
416
 
412
- 75: {
417
+ 74: {
413
418
  file: "@apollo/client/core/ApolloClient.js",
414
419
  condition: "!options.notifyOnNetworkStatusChange",
415
420
  message: "notifyOnNetworkStatusChange option only supported on watchQuery."
416
421
  },
417
422
 
418
- 78: {
423
+ 75: {
424
+ file: "@apollo/client/core/ApolloClient.js",
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/core/ApolloClient.js",
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/core/ObservableQuery.js",
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
- 80: {
441
+ 81: {
425
442
  file: "@apollo/client/core/ObservableQuery.js",
426
443
  condition: "pollInterval",
427
444
  message: "Attempted to start a polling query without a polling interval."
428
445
  },
429
446
 
430
- 82: {
431
- file: "@apollo/client/core/QueryManager.js",
432
- message: "QueryManager stopped while query was in flight"
433
- },
434
-
435
447
  83: {
436
448
  file: "@apollo/client/core/QueryManager.js",
437
- condition: "mutation",
438
- message: "mutation option is required. You must specify your GraphQL document in the mutation option."
449
+ message: "QueryManager stopped while query was in flight"
439
450
  },
440
451
 
441
452
  84: {
442
- file: "@apollo/client/core/QueryManager.js",
443
- condition: "fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\"",
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."
445
- },
446
-
447
- 85: {
448
453
  file: "@apollo/client/core/QueryManager.js",
449
454
  condition: "this.localState",
450
455
  message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
451
456
  },
452
457
 
453
- 86: {
458
+ 85: {
454
459
  file: "@apollo/client/core/QueryManager.js",
455
460
  message: "Store reset while query was in flight (not completed in link chain)"
456
461
  },
457
462
 
458
- 89: {
463
+ 88: {
459
464
  file: "@apollo/client/core/QueryManager.js",
460
465
  condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
461
466
  message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
462
467
  },
463
468
 
464
- 90: {
469
+ 89: {
465
470
  file: "@apollo/client/core/QueryManager.js",
466
471
  condition: "this.localState",
467
472
  message: "%s '%s' contains `@client` fields but local state has not been configured."
468
473
  },
469
474
 
470
- 91: {
475
+ 90: {
471
476
  file: "@apollo/client/core/QueryManager.js",
472
477
  condition: "this.localState",
473
478
  message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
474
479
  },
475
480
 
476
- 93: {
481
+ 92: {
477
482
  file: "@apollo/client/core/QueryManager.js",
478
483
  condition: "this.localState",
479
484
  message: "Query '%s' contains `@client` fields but local state has not been configured."
480
485
  },
481
486
 
482
- 94: {
487
+ 93: {
483
488
  file: "@apollo/client/core/QueryManager.js",
484
489
  condition: "didEmitValue",
485
490
  message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
486
491
  },
487
492
 
488
- 95: {
493
+ 94: {
489
494
  file: "@apollo/client/cache/inmemory/entityStore.js",
490
495
  condition: "typeof dataId === \"string\"",
491
496
  message: "store.merge expects a string ID"
492
497
  },
493
498
 
494
- 98: {
499
+ 97: {
495
500
  file: "@apollo/client/cache/inmemory/key-extractor.js",
496
501
  condition: "extracted !== void 0",
497
502
  message: `Missing field '%s' while extracting keyFields from %s`
498
503
  },
499
504
 
500
- 99: {
505
+ 98: {
501
506
  file: "@apollo/client/cache/inmemory/policies.js",
502
507
  condition: "!old || old === which",
503
508
  message: `Cannot change root %s __typename more than once`
504
509
  },
505
510
 
506
- 102: {
511
+ 101: {
507
512
  file: "@apollo/client/cache/inmemory/policies.js",
508
513
  message: "Cannot automatically merge arrays"
509
514
  },
510
515
 
511
- 103: {
516
+ 102: {
512
517
  file: "@apollo/client/cache/inmemory/readFromStore.js",
513
518
  message: `No fragment named %s`
514
519
  },
515
520
 
516
- 104: {
521
+ 103: {
517
522
  file: "@apollo/client/cache/inmemory/readFromStore.js",
518
523
  condition: "!isReference(value)",
519
524
  message: `Missing selection set for object of type %s returned for query field %s`
520
525
  },
521
526
 
522
- 105: {
527
+ 104: {
523
528
  file: "@apollo/client/cache/inmemory/writeToStore.js",
524
529
  message: `Could not identify object %s`
525
530
  },
526
531
 
527
- 107: {
532
+ 106: {
528
533
  file: "@apollo/client/cache/inmemory/writeToStore.js",
529
534
  message: `No fragment named %s`
530
535
  }
531
536
  };
532
537
 
533
538
  export const devDebug = {
534
- 76: {
539
+ 77: {
535
540
  file: "@apollo/client/core/ApolloClient.js",
536
541
  message: `In client.refetchQueries, Promise.all promise rejected with error %o`
537
542
  },
538
543
 
539
- 81: {
544
+ 82: {
540
545
  file: "@apollo/client/core/ObservableQuery.js",
541
546
  message: `Missing cache result fields: %o`
542
547
  }
@@ -545,21 +550,16 @@ export const devDebug = {
545
550
  export const devLog = {};
546
551
 
547
552
  export const devWarn = {
548
- 35: {
553
+ 36: {
549
554
  file: "@apollo/client/react/hooks/internal/validateSuspenseHookOptions.js",
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
- 40: {
558
+ 41: {
554
559
  file: "@apollo/client/masking/maskDefinition.js",
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
- 44: {
559
- file: "@apollo/client/masking/utils.js",
560
- 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."
561
- },
562
-
563
563
  45: {
564
564
  file: "@apollo/client/masking/utils.js",
565
565
  message: "@unmask 'mode' argument does not support variables."
@@ -595,39 +595,34 @@ export const devWarn = {
595
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."
596
596
  },
597
597
 
598
- 62: {
599
- file: "@apollo/client/link/http/createHttpLink.js",
600
- message: "Multipart-subscriptions do not support @defer"
601
- },
602
-
603
- 65: {
598
+ 64: {
604
599
  file: "@apollo/client/link/core/ApolloLink.js",
605
600
  message: `You are calling concat on a terminating link, which will have no effect %o`
606
601
  },
607
602
 
608
- 77: {
603
+ 78: {
609
604
  file: "@apollo/client/core/ObservableQuery.js",
610
605
 
611
606
  message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
612
607
  Did you mean to call refetch(variables) instead of refetch({ variables })?`
613
608
  },
614
609
 
615
- 87: {
610
+ 86: {
616
611
  file: "@apollo/client/core/QueryManager.js",
617
612
  message: `Unknown query named "%s" requested in refetchQueries options.include array`
618
613
  },
619
614
 
620
- 88: {
615
+ 87: {
621
616
  file: "@apollo/client/core/QueryManager.js",
622
617
  message: `Unknown anonymous query requested in refetchQueries options.include array`
623
618
  },
624
619
 
625
- 92: {
620
+ 91: {
626
621
  file: "@apollo/client/core/QueryManager.js",
627
622
  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.'
628
623
  },
629
624
 
630
- 96: {
625
+ 95: {
631
626
  file: "@apollo/client/cache/inmemory/entityStore.js",
632
627
 
633
628
  message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
@@ -635,24 +630,24 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
635
630
  "`toReference(object, true)`"
636
631
  },
637
632
 
638
- 97: {
633
+ 96: {
639
634
  file: "@apollo/client/cache/inmemory/entityStore.js",
640
635
 
641
636
  message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
642
637
  "Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
643
638
  },
644
639
 
645
- 100: {
640
+ 99: {
646
641
  file: "@apollo/client/cache/inmemory/policies.js",
647
642
  message: `Inferring subtype %s of supertype %s`
648
643
  },
649
644
 
650
- 101: {
645
+ 100: {
651
646
  file: "@apollo/client/cache/inmemory/policies.js",
652
647
  message: `Undefined 'from' passed to readField with arguments %s`
653
648
  },
654
649
 
655
- 108: {
650
+ 107: {
656
651
  file: "@apollo/client/cache/inmemory/writeToStore.js",
657
652
 
658
653
  message: `Cache data may be lost when replacing the %s field of a %s object.
@@ -671,29 +666,29 @@ For more information about these options, please refer to the documentation:
671
666
  `
672
667
  },
673
668
 
674
- 109: {
669
+ 108: {
675
670
  file: "@apollo/client/cache/core/cache.js",
676
671
  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."
677
672
  }
678
673
  };
679
674
 
680
675
  export const devError = {
681
- 13: {
676
+ 14: {
682
677
  file: "@apollo/client/utilities/internal/removeDirectivesFromDocument.js",
683
678
  message: `Could not find operation or fragment`
684
679
  },
685
680
 
686
- 33: {
681
+ 34: {
687
682
  file: "@apollo/client/react/hooks/useSyncExternalStore.js",
688
683
  message: "The result of getSnapshot should be cached to avoid an infinite loop"
689
684
  },
690
685
 
691
- 79: {
686
+ 80: {
692
687
  file: "@apollo/client/core/ObservableQuery.js",
693
688
  message: "Unhandled GraphQL subscription error"
694
689
  },
695
690
 
696
- 106: {
691
+ 105: {
697
692
  file: "@apollo/client/cache/inmemory/writeToStore.js",
698
693
  message: `Missing field '%s' while writing result %o`
699
694
  }
@@ -0,0 +1 @@
1
+ module.exports = require("@apollo/client/link/client-awareness");
@@ -0,0 +1 @@
1
+ export * from "@apollo/client/link/client-awareness";
@@ -0,0 +1 @@
1
+ export * from "@apollo/client/link/client-awareness";
@@ -0,0 +1 @@
1
+ export * from "@apollo/client/link/client-awareness";
@@ -2,6 +2,7 @@ import { Observable } from "rxjs";
2
2
  import type { FetchResult, Operation } from "@apollo/client/link";
3
3
  import { ApolloLink } from "@apollo/client/link";
4
4
  import { BatchLink } from "@apollo/client/link/batch";
5
+ import { ClientAwarenessLink } from "@apollo/client/link/client-awareness";
5
6
  import type { HttpLink } from "@apollo/client/link/http";
6
7
  export declare namespace BatchHttpLink {
7
8
  type Options = Pick<BatchLink.Options, "batchMax" | "batchDebounce" | "batchInterval" | "batchKey"> & Omit<HttpLink.Options, "useGETForQueries">;
@@ -12,6 +13,9 @@ export declare namespace BatchHttpLink {
12
13
  * context can include the headers property, which will be passed to the fetch function
13
14
  */
14
15
  export declare class BatchHttpLink extends ApolloLink {
16
+ constructor(options?: BatchHttpLink.Options & ClientAwarenessLink.Options);
17
+ }
18
+ export declare class BaseBatchHttpLink extends ApolloLink {
15
19
  private batchDebounce?;
16
20
  private batchInterval;
17
21
  private batchMax;