@apollo/client 3.10.8 → 3.11.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/angry-ravens-mate.md +5 -0
- package/.changeset/angry-seals-jog.md +5 -0
- package/.changeset/chilly-dots-shake.md +5 -0
- package/.changeset/clever-bikes-admire.md +5 -0
- package/.changeset/curly-vans-draw.md +5 -0
- package/.changeset/flat-onions-guess.md +5 -0
- package/.changeset/fluffy-badgers-rush.md +5 -0
- package/.changeset/good-suns-happen.md +5 -0
- package/.changeset/hungry-rings-help.md +5 -0
- package/.changeset/little-suits-return.md +5 -0
- package/.changeset/nasty-olives-act.md +5 -0
- package/.changeset/pink-ants-remember.md +16 -0
- package/.changeset/pre.json +27 -0
- package/.changeset/slimy-balloons-cheat.md +5 -0
- package/.changeset/slimy-berries-yawn.md +14 -0
- package/.changeset/tasty-chairs-dress.md +5 -0
- package/.changeset/thin-lies-begin.md +5 -0
- package/.changeset/unlucky-birds-press.md +5 -0
- package/.changeset/weak-ads-develop.md +5 -0
- package/CHANGELOG.md +70 -4
- package/apollo-client.cjs +504 -418
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +2 -7
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +2 -7
- package/cache/core/cache.d.ts +0 -11
- package/cache/core/cache.js +2 -7
- package/cache/core/cache.js.map +1 -1
- package/core/ApolloClient.d.ts +24 -2
- package/core/ApolloClient.js +10 -9
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.js +5 -1
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +2 -2
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +1 -1
- package/core/QueryManager.js +5 -4
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +19 -12
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +19 -12
- package/core/types.d.ts +2 -2
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +4 -0
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +40 -34
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +40 -34
- package/errors/errors.cjs +4 -0
- package/errors/errors.cjs.map +1 -1
- package/errors/errors.cjs.native.js +4 -0
- package/errors/index.d.ts +18 -3
- package/errors/index.js +7 -2
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.js +41 -34
- package/link/core/types.d.ts +6 -4
- package/link/core/types.js.map +1 -1
- package/link/error/index.d.ts +4 -4
- package/link/error/index.js.map +1 -1
- package/link/persisted-queries/index.d.ts +3 -3
- package/link/persisted-queries/index.js.map +1 -1
- package/link/subscriptions/index.js +1 -0
- package/link/subscriptions/index.js.map +1 -1
- package/link/subscriptions/subscriptions.cjs.map +1 -1
- package/package.json +29 -29
- package/react/hooks/hooks.cjs +445 -368
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +445 -368
- package/react/hooks/internal/wrapHook.d.ts +2 -0
- package/react/hooks/internal/wrapHook.js.map +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +15 -1
- package/react/hooks/useBackgroundQuery.js +5 -1
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useLazyQuery.js +54 -12
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +7 -1
- package/react/hooks/useLoadableQuery.js +5 -1
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useQuery.d.ts +34 -47
- package/react/hooks/useQuery.js +387 -388
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +7 -1
- package/react/hooks/useQueryRefHandlers.js +5 -1
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +13 -10
- package/react/hooks/useSubscription.js +130 -98
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseQuery.js +3 -3
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/internal/internal.cjs +2 -2
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +2 -2
- package/react/parser/index.js +5 -5
- package/react/parser/parser.cjs +5 -5
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +5 -5
- package/react/query-preloader/createQueryPreloader.js +5 -1
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/react.cjs +12 -1
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +12 -1
- package/react/types/types.d.ts +19 -0
- package/react/types/types.documentation.d.ts +10 -0
- package/react/types/types.documentation.js.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +6 -5
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +6 -5
- package/testing/core/mocking/mockLink.js +8 -7
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/experimental/createSchemaFetch.d.ts +2 -0
- package/testing/experimental/createSchemaFetch.js +12 -1
- package/testing/experimental/createSchemaFetch.js.map +1 -1
- package/testing/experimental/createTestSchema.d.ts +2 -0
- package/testing/experimental/createTestSchema.js +2 -0
- package/testing/experimental/createTestSchema.js.map +1 -1
- package/testing/experimental/experimental.cjs +5 -1
- package/testing/experimental/experimental.cjs.map +1 -1
- package/testing/experimental/experimental.cjs.native.js +5 -1
- package/testing/internal/disposables/enableFakeTimers.d.ts +7 -0
- package/testing/internal/disposables/enableFakeTimers.js +16 -0
- package/testing/internal/disposables/enableFakeTimers.js.map +1 -0
- package/testing/internal/disposables/index.d.ts +1 -0
- package/testing/internal/disposables/index.js +1 -0
- package/testing/internal/disposables/index.js.map +1 -1
- package/utilities/common/errorHandling.d.ts +1 -1
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +4 -4
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.js +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/utilities.cjs +19 -19
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +19 -19
- package/version.js +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@apollo/client": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Add the ability to specify a name for the client instance for use with Apollo Client Devtools. This is useful when instantiating multiple clients to identify the client instance more easily. This deprecates the `connectToDevtools` option in favor of a new `devtools` configuration.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
new ApolloClient({
|
|
9
|
+
devtools: {
|
|
10
|
+
enabled: true,
|
|
11
|
+
name: "Test Client",
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This option is backwards-compatible with `connectToDevtools` and will be used in the absense of a `devtools` option.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mode": "pre",
|
|
3
|
+
"tag": "rc",
|
|
4
|
+
"initialVersions": {
|
|
5
|
+
"@apollo/client": "3.10.8"
|
|
6
|
+
},
|
|
7
|
+
"changesets": [
|
|
8
|
+
"angry-ravens-mate",
|
|
9
|
+
"angry-seals-jog",
|
|
10
|
+
"chilly-dots-shake",
|
|
11
|
+
"clever-bikes-admire",
|
|
12
|
+
"curly-vans-draw",
|
|
13
|
+
"flat-onions-guess",
|
|
14
|
+
"fluffy-badgers-rush",
|
|
15
|
+
"good-suns-happen",
|
|
16
|
+
"hungry-rings-help",
|
|
17
|
+
"little-suits-return",
|
|
18
|
+
"nasty-olives-act",
|
|
19
|
+
"pink-ants-remember",
|
|
20
|
+
"slimy-balloons-cheat",
|
|
21
|
+
"slimy-berries-yawn",
|
|
22
|
+
"tasty-chairs-dress",
|
|
23
|
+
"thin-lies-begin",
|
|
24
|
+
"unlucky-birds-press",
|
|
25
|
+
"weak-ads-develop"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@apollo/client": minor
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Changes usages of the `GraphQLError` type to `GraphQLFormattedError`.
|
|
6
|
+
|
|
7
|
+
This was a type bug - these errors were never `GraphQLError` instances
|
|
8
|
+
to begin with, and the `GraphQLError` class has additional properties that can
|
|
9
|
+
never be correctly rehydrated from a GraphQL result.
|
|
10
|
+
The correct type to use here is `GraphQLFormattedError`.
|
|
11
|
+
|
|
12
|
+
Similarly, please ensure to use the type `FormattedExecutionResult`
|
|
13
|
+
instead of `ExecutionResult` - the non-"Formatted" versions of these types
|
|
14
|
+
are for use on the server only, but don't get transported over the network.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# @apollo/client
|
|
2
2
|
|
|
3
|
+
## 3.11.0-rc.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#11949](https://github.com/apollographql/apollo-client/pull/11949) [`4528918`](https://github.com/apollographql/apollo-client/commit/45289186bcaaa33dfe904913eb6df31e2541c219) Thanks [@alessbell](https://github.com/alessbell)! - Remove deprecated `watchFragment` option, `canonizeResults`
|
|
8
|
+
|
|
9
|
+
- [#11926](https://github.com/apollographql/apollo-client/pull/11926) [`3dd6432`](https://github.com/apollographql/apollo-client/commit/3dd64324dc5156450cead27f8141ea93315ffe65) Thanks [@phryneas](https://github.com/phryneas)! - `watchFragment`: forward additional options to `diffOptions`
|
|
10
|
+
|
|
11
|
+
- [#11946](https://github.com/apollographql/apollo-client/pull/11946) [`7d833b8`](https://github.com/apollographql/apollo-client/commit/7d833b80119a991e6d2eb58f2c71074d697b8e63) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix issue where mutations were not accessible by Apollo Client Devtools in 3.11.0-rc.0.
|
|
12
|
+
|
|
13
|
+
## 3.11.0-rc.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#11923](https://github.com/apollographql/apollo-client/pull/11923) [`d88c7f8`](https://github.com/apollographql/apollo-client/commit/d88c7f8909e3cb31532e8b1fc7dd06be12f35591) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add support for `subscribeToMore` function to `useQueryRefHandlers`.
|
|
18
|
+
|
|
19
|
+
- [#11854](https://github.com/apollographql/apollo-client/pull/11854) [`3812800`](https://github.com/apollographql/apollo-client/commit/3812800c6e4e5e3e64f473543babdba35ce100c2) Thanks [@jcostello-atlassian](https://github.com/jcostello-atlassian)! - Support extensions in useSubscription
|
|
20
|
+
|
|
21
|
+
- [#11923](https://github.com/apollographql/apollo-client/pull/11923) [`d88c7f8`](https://github.com/apollographql/apollo-client/commit/d88c7f8909e3cb31532e8b1fc7dd06be12f35591) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add support for `subscribeToMore` function to `useLoadableQuery`.
|
|
22
|
+
|
|
23
|
+
- [#11863](https://github.com/apollographql/apollo-client/pull/11863) [`98e44f7`](https://github.com/apollographql/apollo-client/commit/98e44f74cb7c7e93a81bdc7492c9218bf4a2dcd4) Thanks [@phryneas](https://github.com/phryneas)! - Reimplement `useSubscription` to fix rules of React violations.
|
|
24
|
+
|
|
25
|
+
- [#11869](https://github.com/apollographql/apollo-client/pull/11869) [`a69327c`](https://github.com/apollographql/apollo-client/commit/a69327cce1b36e8855258e9b19427511e0af8748) Thanks [@phryneas](https://github.com/phryneas)! - Rewrite big parts of `useQuery` and `useLazyQuery` to be more compliant with the Rules of React and React Compiler
|
|
26
|
+
|
|
27
|
+
- [#11936](https://github.com/apollographql/apollo-client/pull/11936) [`1b23337`](https://github.com/apollographql/apollo-client/commit/1b23337e5a9eec4ce3ed69531ca4f4afe8e897a6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add the ability to specify a name for the client instance for use with Apollo Client Devtools. This is useful when instantiating multiple clients to identify the client instance more easily. This deprecates the `connectToDevtools` option in favor of a new `devtools` configuration.
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
new ApolloClient({
|
|
31
|
+
devtools: {
|
|
32
|
+
enabled: true,
|
|
33
|
+
name: "Test Client",
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This option is backwards-compatible with `connectToDevtools` and will be used in the absense of a `devtools` option.
|
|
39
|
+
|
|
40
|
+
- [#11923](https://github.com/apollographql/apollo-client/pull/11923) [`d88c7f8`](https://github.com/apollographql/apollo-client/commit/d88c7f8909e3cb31532e8b1fc7dd06be12f35591) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add support for `subscribeToMore` function to `useBackgroundQuery`.
|
|
41
|
+
|
|
42
|
+
- [#11789](https://github.com/apollographql/apollo-client/pull/11789) [`5793301`](https://github.com/apollographql/apollo-client/commit/579330147d6bd6f7167a35413a33746103e375cb) Thanks [@phryneas](https://github.com/phryneas)! - Changes usages of the `GraphQLError` type to `GraphQLFormattedError`.
|
|
43
|
+
|
|
44
|
+
This was a type bug - these errors were never `GraphQLError` instances
|
|
45
|
+
to begin with, and the `GraphQLError` class has additional properties that can
|
|
46
|
+
never be correctly rehydrated from a GraphQL result.
|
|
47
|
+
The correct type to use here is `GraphQLFormattedError`.
|
|
48
|
+
|
|
49
|
+
Similarly, please ensure to use the type `FormattedExecutionResult`
|
|
50
|
+
instead of `ExecutionResult` - the non-"Formatted" versions of these types
|
|
51
|
+
are for use on the server only, but don't get transported over the network.
|
|
52
|
+
|
|
53
|
+
- [#11930](https://github.com/apollographql/apollo-client/pull/11930) [`a768575`](https://github.com/apollographql/apollo-client/commit/a768575ac1454587208aad63abc811b6a966fe72) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Deprecates experimental schema testing utilities introduced in 3.10 in favor of recommending [`@apollo/graphql-testing-library`](https://github.com/apollographql/graphql-testing-library).
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- [#11927](https://github.com/apollographql/apollo-client/pull/11927) [`2941824`](https://github.com/apollographql/apollo-client/commit/2941824dd66cdd20eee5f2293373ad7a9cf991a4) Thanks [@phryneas](https://github.com/phryneas)! - Add `restart` function to `useSubscription`.
|
|
58
|
+
|
|
59
|
+
- [#11902](https://github.com/apollographql/apollo-client/pull/11902) [`96422ce`](https://github.com/apollographql/apollo-client/commit/96422ce95b923b560321a88acd2eec35cf2a1c18) Thanks [@phryneas](https://github.com/phryneas)! - Add `cause` field to `ApolloError`.
|
|
60
|
+
|
|
61
|
+
- [#11806](https://github.com/apollographql/apollo-client/pull/11806) [`8df6013`](https://github.com/apollographql/apollo-client/commit/8df6013b6b45452ec058fab3e068b5b6d6c493f7) Thanks [@phryneas](https://github.com/phryneas)! - MockLink: add query default variables if not specified in mock request
|
|
62
|
+
|
|
63
|
+
- [#11626](https://github.com/apollographql/apollo-client/pull/11626) [`228429a`](https://github.com/apollographql/apollo-client/commit/228429a1d36eae691473b24fb641ec3cd84c8a3d) Thanks [@phryneas](https://github.com/phryneas)! - Call `nextFetchPolicy` with "variables-changed" even if there is a `fetchPolicy` specified. (fixes #11365)
|
|
64
|
+
|
|
65
|
+
- [#11719](https://github.com/apollographql/apollo-client/pull/11719) [`09a6677`](https://github.com/apollographql/apollo-client/commit/09a6677ec1a0cffedeecb2cbac5cd3a3c8aa0fa1) Thanks [@phryneas](https://github.com/phryneas)! - Allow wrapping `createQueryPreloader`
|
|
66
|
+
|
|
67
|
+
- [#11921](https://github.com/apollographql/apollo-client/pull/11921) [`70406bf`](https://github.com/apollographql/apollo-client/commit/70406bfd2b9a645d781638569853d9b435e047df) Thanks [@phryneas](https://github.com/phryneas)! - add `ignoreResults` option to `useSubscription`
|
|
68
|
+
|
|
3
69
|
## 3.10.8
|
|
4
70
|
|
|
5
71
|
### Patch Changes
|
|
@@ -457,7 +523,7 @@
|
|
|
457
523
|
import { Environment, Network, RecordSource, Store } from "relay-runtime";
|
|
458
524
|
|
|
459
525
|
const fetchMultipartSubs = createFetchMultipartSubscription(
|
|
460
|
-
"http://localhost:4000"
|
|
526
|
+
"http://localhost:4000"
|
|
461
527
|
);
|
|
462
528
|
|
|
463
529
|
const network = Network.create(fetchQuery, fetchMultipartSubs);
|
|
@@ -810,7 +876,7 @@
|
|
|
810
876
|
return data.breeds.map(({ characteristics }) =>
|
|
811
877
|
characteristics.map((characteristic) => (
|
|
812
878
|
<div key={characteristic}>{characteristic}</div>
|
|
813
|
-
))
|
|
879
|
+
))
|
|
814
880
|
);
|
|
815
881
|
}
|
|
816
882
|
```
|
|
@@ -861,7 +927,7 @@
|
|
|
861
927
|
|
|
862
928
|
const { data } = useSuspenseQuery(
|
|
863
929
|
query,
|
|
864
|
-
id ? { variables: { id } } : skipToken
|
|
930
|
+
id ? { variables: { id } } : skipToken
|
|
865
931
|
);
|
|
866
932
|
```
|
|
867
933
|
|
|
@@ -2816,7 +2882,7 @@ In upcoming v3.6.x and v3.7 (beta) releases, we will be completely overhauling o
|
|
|
2816
2882
|
fields: {
|
|
2817
2883
|
comments(comments: Reference[], { readField }) {
|
|
2818
2884
|
return comments.filter(
|
|
2819
|
-
(comment) => idToRemove !== readField("id", comment)
|
|
2885
|
+
(comment) => idToRemove !== readField("id", comment)
|
|
2820
2886
|
);
|
|
2821
2887
|
},
|
|
2822
2888
|
},
|