Skip to content

Propagate mutation meta to default onError handler (from defaultOptions.mutations) #8964

Answered by TkDodo
rodion-optifino asked this question in Ideas
Discussion options

You must be logged in to vote

the 4th argument isn’t meta, it’s the mutation instance itself, which has a .meta field.

The defaultOptions are observer options - the same ones you pass to useMutation, and there, we also don’t pass the mutation itself.

My use case is to provide human-readable title for errors that handled in a general way and I want to use mutation meta to do so.

It’s probably best to do this in the global error handler.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@rodion-optifino
Comment options

@TkDodo
Comment options

@rodion-optifino
Comment options

@TkDodo
Comment options

@rodion-optifino
Comment options

Answer selected by rodion-optifino
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants