Can we maskError in onValidate Plugin hook? #3900
Unanswered
aryascripts
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current Behaviour
Hello, we are wondering if this is expected behaviour about error masking that is described here: https://the-guild.dev/graphql/yoga-server/docs/features/error-masking#customize-error-masking
Currently, for the plugin lifecycle, the behaviour is that these hooks do not go through maskError logic that is for the end-response to the client.
Desired Behaviour
We want to throw (or
setResult
) fromonValidate
hook with as much detail as possible for our metrics and logging, but also be able to mask these errors from real clients.There's a failing test implemented here for what we would ideally like (see
test 1
in PR)What we tried
We have tried implementing our own maskError logic inside of
onValidate
(sample code and test below), but that has the side effect of already-masked errors returned from the validation cache. Seetest 2
in PR.These examples are described in these tests in the PR: #3899
Beta Was this translation helpful? Give feedback.
All reactions