GraphQL Resolver Middleware
⨠ GraphQL resolver middleware composer
What does it do?
Adding all the functionality needed for individual resolvers can end up in a lot of boilerplate code and messy resolver functions.
graphql-resolver-middleware solves this problem by allowing you to compose middleware for each resolver, allowing you to create complex workflows around your data in a clean manner.
Some common problems you can solve with resolver middleware are authentication, authorization, logging, timing, analytics gathering, extending context, etc.
Check out the launchpad examples below!
How does it do it?
graphql-resolver-middleware exports a single function that takes N number of middleware and applies them serially to the resolver parameters, allowing you to either error out if certain conditions are not met or extend functionality by extending/mutating the context property.
;;; const middleware = ; const resolvers = Query: hello: