express-graphql icon indicating copy to clipboard operation
express-graphql copied to clipboard

Support for running method on every call

Open dlandtaa opened this issue 2 years ago • 0 comments

Is there any concept of running a function before each graphql endpoint is executed? I'd like to have this for things like validating JWTs and other things. I realize we could use express for this, e.g.

app.use('/graphql`, doChecks);

but I'd like for the graphql handler to throw an error so it'll be inside the errors: [] list in the results giving the client a consistent experience with the api. Is there any direct support for this in the package?

dlandtaa avatar Jan 23 '23 14:01 dlandtaa