Releases: apollographql/apollo-client
v3.8.0-beta.2
v3.8.0-beta.1
3.8.0-beta.1
Patch Changes
-
#10937
eea44eb87
Thanks @jerelmiller! - MovesDocumentTransform
to theutilities
sub-package to avoid a circular dependency between thecore
andcache
sub-packages. -
#10919
f796ce1ac
Thanks @jerelmiller! - Fix an issue when using a link that relied onoperation.getContext
andoperation.setContext
would error out when it was declared after theremoveTypenameFromVariables
link.
v3.8.0-beta.0
3.8.0-beta.0
Minor Changes
-
#10887
f8c0b965d
Thanks @phryneas! - Add a new mechanism for Error Extraction to reduce bundle size by including
error message texts on an opt-in basis.
By default, errors will link to an error page with the entire error message.
This replaces "development" and "production" errors and works without
additional bundler configuration.
Bundling the text of error messages and development warnings can be enabled byimport { loadErrorMessages, loadDevMessages } from "@apollo/client/dev"; if (process.env.NODE_ENV !== "production") { loadErrorMessages(); loadDevMessages(); }
-
#10509
79df2c7ba
Thanks @jerelmiller! - Add the ability to specify custom GraphQL document transforms. These transforms are run before reading data from the cache, before local state is resolved, and before the query document is sent through the link chain.To register a custom document transform, create a transform using the
DocumentTransform
class and pass it to thedocumentTransform
option onApolloClient
.import { DocumentTransform } from "@apollo/client"; const documentTransform = new DocumentTransform((document) => { // do something with `document` return transformedDocument; }); const client = new ApolloClient({ documentTransform: documentTransform });
For additional documentation on the behavior and API of
DocumentTransform
, see the pull request. -
#10916
ea75e18de
Thanks @alessbell! - Remove experimental labels from hooks, move to beta.
v3.7.15
Patch Changes
-
#10891
ab42a5c08
Thanks @laverdet! - Fixes a bug in how multipart responses are read when using@defer
. When reading a multipart body,HttpLink
no longer attempts to parse the boundary (e.g."---"
or other boundary string) within the response data itself, only when reading the beginning of each mulitpart chunked message. -
#10789
23a4e1578
Thanks @phryneas! - Fix a bug where other fields could be aliased to__typename
orid
, in which case an incoming result would be merged into the wrong cache entry.
New Contributors
v3.8.0-alpha.15
3.8.0-alpha.15
Patch Changes
-
#10888
1562a2f5a
Thanks @alessbell! - Updates dependency versions inpackage.json
by bumping:@wry/context
to^0.7.3
@wry/equality
to^0.5.6
@wry/trie
to^0.4.3
optimism
to^0.17.4
to 1. fix sourcemap warnings and 2. a Codesandbox sandpack (in-browser) bundler transpilation bug with an upstream optimism workaround.
v3.8.0-alpha.14
3.8.0-alpha.14
Minor Changes
-
#10755
e3c676deb
Thanks @alessbell! - Feature: addsuseBackgroundQuery
anduseReadQuery
hooks -
#10853
300957960
Thanks @jerelmiller! - Introduce the newremoveTypenameFromVariables
link. This link will automatically remove__typename
fields fromvariables
for all operations. This link can be configured to exclude JSON-scalars for scalars that utilize__typename
.This change undoes some work from #10724 where
__typename
was automatically stripped for all operations with no configuration. This was determined to be a breaking change and therefore moved into this link.
Patch Changes
-
#10869
ba1d06166
Thanks @phryneas! - Ensure Context value stability when rerendering ApolloProvider with the sameclient
and/orsuspenseCache
prop -
#10789
23a4e1578
Thanks @phryneas! - Fix a bug where other fields could be aliased to__typename
orid
, in which case an incoming result would be merged into the wrong cache entry. -
#10765
35f36c5aa
Thanks @phryneas! - More robust types for thedata
property onUseFragmentResult
. When a partial result is given, the type is now correctly set toPartial<TData>
. -
#10852
27fbdb3f9
Thanks @phryneas! - Chore: Add ESLint rule for consistent type imports, apply autofix -
#10877
f40248598
Thanks @phryneas! - Change an import inuseQuery
anduseMutation
that added an unnecessary runtime dependency on@apollo/client/core
. This drastically reduces the bundle size of each the hooks. -
#10836
6794893c2
Thanks @phryneas! - Remove the deprecatedreturnPartialData
option fromuseFragment
hook. -
#10872
96b4f8837
Thanks @phryneas! - The "per-React-Version-Singleton" ApolloContext is now stored onglobalThis
, notReact.createContext
, and throws an error message when accessed from React Server Components.
v3.8.0-alpha.13
3.8.0-alpha.13
Patch Changes
-
#10766
ffb179e55
Thanks @jerelmiller! - More robust typings for thedata
property returned fromuseSuspenseQuery
when usingreturnPartialData: true
or anerrorPolicy
ofall
orignore
.TData
now defaults tounknown
instead ofany
. -
#10809
49d28f764
Thanks @jerelmiller! - Fixed the ability to userefetch
andfetchMore
with React'sstartTransition
. The hook will now behave correctly by allowing React to avoid showing the Suspense fallback when these functions are wrapped bystartTransition
. This change deprecates thesuspensePolicy
option in favor ofstartTransition
.
v3.7.14
Patch Changes
-
#10764
1b0a61fe5
Thanks @phryneas! - DeprecateuseFragment
returnPartialData
option -
#10810
a6252774f
Thanks @dleavitt! - Fix type signature ofServerError
.In <3.7
HttpLink
andBatchHttpLink
would return aServerError.message
of e.g."Unexpected token 'E', \"Error! Foo bar\" is not valid JSON"
and aServerError.result
ofundefined
in the case where a server returned a >= 300 response code with a response body containing a string that could not be parsed as JSON.In >=3.7,
message
became e.g.Response not successful: Received status code 302
andresult
became the string from the response body, however the type inServerError.result
was not updated to include thestring
type, which is now properly reflected.
v3.7.13
Patch Changes
-
#10805
a5503666c
Thanks @phryneas! - Fix a potential memory leak in SSR scenarios when manypersistedQuery
instances were created over time. -
#10718
577c68bdd
Thanks @Hsifnus! - Delay Concast subscription teardown slightly inuseSubscription
to prevent unexpected Concast teardown when oneuseSubscription
hook tears down its in-flight Concast subscription immediately followed by anotheruseSubscription
hook reusing and subscribing to that same Concast
v3.8.0-alpha.12
3.8.0-alpha.12
Minor Changes
- #10722
c7e60f83d
Thanks @benjamn! - Implement a@nonreactive
directive for selectively skipping reactive comparisons of query result subtrees
Patch Changes
-
#10700
12e37f46f
Thanks @jerelmiller! - Add aqueryKey
option touseSuspenseQuery
that allows the hook to create a unique subscription instance. -
#10724
e285dfd00
Thanks @jerelmiller! - Automatically strips__typename
fields fromvariables
sent to the server when usingHttpLink
,BatchHttpLink
, orGraphQLWsLink
. This allows GraphQL data returned from a query to be used as an argument to a subsequent GraphQL operation without the need to strip the__typename
in user-space. -
#10754
64b304862
Thanks @sincraianul! - FixincludeUnusedVariables
option not working withBatchHttpLink
-
#10758
9def7421f
Thanks @phryneas! - useReact.use
where available