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