Open asermax opened 2 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit f60c661e57941b072c455edd7459d9e7bddb3466:
Sandbox | Source |
---|---|
@tanstack/query-example-angular-basic | Configuration |
@tanstack/query-example-react-basic-typescript | Configuration |
@tanstack/query-example-solid-basic-typescript | Configuration |
@tanstack/query-example-svelte-basic | Configuration |
@tanstack/query-example-vue-basic | Configuration |
This PR adds a context that's passed as the second parameter to the
mutationFn
in a mutation. This change allows access to the mutation'smeta
(similar to query functions), which I find useful for passing in configurations (similarly as the case mentioned in https://github.com/TanStack/query/discussions/7045#discussioncomment-9151048). I've also included themutationKey
in the context, since it came up in a similar discussion #3504.While this context could eventually include other information, I kept this initial contribution small and simple as to not get all tangled up with all the typing :sweat_smile: