#118887fb7939 Thanks @phryneas! - switch useRenderGuard to an approach not accessing React's internals
#115116536369 Thanks @phryneas! - useLoadableQuery: ensure that loadQuery is updated if the ApolloClient instance changes
#118608740f19 Thanks @alessbell! - Fixes #11849 by reevaluating window.fetch each time BatchHttpLink uses it, if not configured via options.fetch. Takes the same approach as PR #8603 which fixed the same issue in HttpLink.
#11852d502a69 Thanks @phryneas! - Fix a bug where calling the useMutationreset function would point the hook to an outdated client reference.
#113293d164ea Thanks @PaLy! - Fix graphQLErrors in Error Link if networkError.result is an empty string
#11852d502a69 Thanks @phryneas! - Prevent writing to a ref in render in useMutation.
As a result, you might encounter problems in the future if you call the mutation's execute function during render. Please note that this was never supported behavior, and we strongly recommend against it.
#11848ad63924 Thanks @phryneas! - Ensure covariant behavior: MockedResponse<X,Y> should be assignable to MockedResponse
#1185145c47be Thanks @phryneas! - Avoid usage of useRef in useInternalState to prevent ref access in render.
#118396481fe1 Thanks @jerelmiller! - Fix a regression in 3.9.5 where a merge function that returned an incomplete result would not allow the client to refetch in order to fulfill the query.
#1184486984f2 Thanks @jerelmiller! - Honor the @nonreactive directive when using cache.watchFragment or the useFragment hook to avoid rerendering when using these directives.
This change deprecates QueryReference in favor of a QueryRef type that doesn't expose any properties.
This change also updates preloadQuery to return a new PreloadedQueryRef type, which exposes the toPromise function as it does today. This means that query refs produced by useBackgroundQuery and useLoadableQuery now return QueryRef types that do not have access to a toPromise function, which was never meant to be used in combination with these hooks.
While we tend to avoid any types of breaking changes in patch releases as this, this change was necessary to support an upcoming version of the React Server Component integration, which needed to omit the toPromise function that would otherwise have broken at runtime.
Note that this is a TypeScript-only change. At runtime, toPromise is still present on all queryRefs currently created by this package - but we strongly want to discourage you from accessing it in all cases except for the PreloadedQueryRef use case.
Migration is as simple as replacing all references to QueryReference with QueryRef, so it should be possible to do this with a search & replace in most code bases:
-import { QueryReference } from '@apollo/client'
+import { QueryRef } from '@apollo/client'
function Component({ queryRef }: { queryRef: QueryReference<TData> }) {
#118887fb7939 Thanks @phryneas! - switch useRenderGuard to an approach not accessing React's internals
#115116536369 Thanks @phryneas! - useLoadableQuery: ensure that loadQuery is updated if the ApolloClient instance changes
#118608740f19 Thanks @alessbell! - Fixes #11849 by reevaluating window.fetch each time BatchHttpLink uses it, if not configured via options.fetch. Takes the same approach as PR #8603 which fixed the same issue in HttpLink.
#11852d502a69 Thanks @phryneas! - Fix a bug where calling the useMutationreset function would point the hook to an outdated client reference.
#113293d164ea Thanks @PaLy! - Fix graphQLErrors in Error Link if networkError.result is an empty string
#11852d502a69 Thanks @phryneas! - Prevent writing to a ref in render in useMutation.
As a result, you might encounter problems in the future if you call the mutation's execute function during render. Please note that this was never supported behavior, and we strongly recommend against it.
#11848ad63924 Thanks @phryneas! - Ensure covariant behavior: MockedResponse<X,Y> should be assignable to MockedResponse
#1185145c47be Thanks @phryneas! - Avoid usage of useRef in useInternalState to prevent ref access in render.
#118396481fe1 Thanks @jerelmiller! - Fix a regression in 3.9.5 where a merge function that returned an incomplete result would not allow the client to refetch in order to fulfill the query.
#1184486984f2 Thanks @jerelmiller! - Honor the @nonreactive directive when using cache.watchFragment or the useFragment hook to avoid rerendering when using these directives.
This change deprecates QueryReference in favor of a QueryRef type that doesn't expose any properties.
This change also updates preloadQuery to return a new PreloadedQueryRef type, which exposes the toPromise function as it does today. This means that query refs produced by useBackgroundQuery and useLoadableQuery now return QueryRef types that do not have access to a toPromise function, which was never meant to be used in combination with these hooks.
While we tend to avoid any types of breaking changes in patch releases as this, this change was necessary to support an upcoming version of the React Server Component integration, which needed to omit the toPromise function that would otherwise have broken at runtime.
Note that this is a TypeScript-only change. At runtime, toPromise is still present on all queryRefs currently created by this package - but we strongly want to discourage you from accessing it in all cases except for the PreloadedQueryRef use case.
Migration is as simple as replacing all references to QueryReference with QueryRef, so it should be possible to do this with a search & replace in most code bases:
-import { QueryReference } from '@apollo/client'
+import { QueryRef } from '@apollo/client'
function Component({ queryRef }: { queryRef: QueryReference<TData> }) {
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps @apollo/client from 3.8.1 to 3.10.5.
Release notes
Sourced from
@apollo/client
's releases.... (truncated)
Changelog
Sourced from
@apollo/client
's changelog.... (truncated)
Commits
a739dfd
Version Packages (#11855)e41580b
Revert "Update router terminology (#11885)" (#11892)5f5326b
docs: add graphql-tag-swc-plugin to performance docs (#11884)3d164ea
fix: graphQLErrors in Error Link if networkError.result is an empty string (#...1aca223
Update router terminology (#11885)3e5e770
chore(deps-dev): bump braces from 3.0.2 to 3.0.3 (#11887)7fb7939
switchuseRenderGuard
to an approach not accessing React's internals (#11888)6536369
enablereact-hooks
lint rules (#11511)08dbc02
use circleci-browsers
image to save some install time (#11889)6ca5ef4
start testing with React 19 (#11883)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show