Skip to content

Commit

Permalink
Add more information about deprecation of useMutation ignoreResults o…
Browse files Browse the repository at this point in the history
…ption (#12301)

* Add more information about deprecation of useMutation ignoreResults option

* PR Review

* Update src/react/types/types.ts

---------

Co-authored-by: Lenz Weber-Tronic <[email protected]>
Co-authored-by: Lenz Weber-Tronic <[email protected]>
  • Loading branch information
3 people authored Jan 27, 2025
1 parent bbfb44c commit ec7e46c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .changeset/khaki-cars-develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
---

Deprecate option `ignoreResults` in `useMutation`.
Once this option is removed, existing code still using it might see increase in re-renders.
If you don't want to synchronize your component state with the mutation, please use `useApolloClient` to get your ApolloClient instance and call `client.mutate` directly.
4 changes: 3 additions & 1 deletion src/react/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ export interface BaseMutationOptions<
onError?: (error: ApolloError, clientOptions?: BaseMutationOptions) => void;
/**
* {@inheritDoc @apollo/client!MutationOptionsDocumentation#ignoreResults:member}
* @deprecated This property will be removed in the next major version of Apollo Client
*
* @deprecated This option will be removed in the next major version of Apollo Client.
* If you don't want to synchronize your component state with the mutation, please use `useApolloClient` to get your ApolloClient instance and call `client.mutate` directly.
*/
ignoreResults?: boolean;
}
Expand Down

0 comments on commit ec7e46c

Please sign in to comment.