Skip to content

useMutation with different URL #1235

Answered by kitten
conormcafee asked this question in Q&A
Discussion options

You must be logged in to vote

The executeMutation function accepts variables and optionally Partial and may be used to start executing a mutation. It returns a Promise resolving to an OperationResult.

This is referring to arguments, so the first argument, as per this are variables the second is a partial context, so by that you'll have to pass executeMutation(vars, { context: url })

That being said, I'm generally curious why you're altering the mutation's URL per mutation here. But either way, the above will work just fine 👍

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@conormcafee
Comment options

Answer selected by kitten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants