Skip to content

validation exchange #1084

Answered by kitten
Manborough asked this question in Q&A
Oct 22, 2020 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

You'll probably want to mimick the errors a server would send back for invalid variables, so instead of dropping the mutation you may want to instead send a mock response in your exchange immediately that contains an actual error. You can even do this without constructing a full response, since we have a helper that converts a server result to an urql result (with a CombinedError). So if you wanted to just write a simple networkError this would help: https://formidable.com/open-source/urql/docs/api/core/#makeerrorresult

However it'd probably make more sense for your exchange to output a result with GraphQLError instances using this helper: https://formidable.com/open-source/urql/docs/api/…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Manborough
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