Add `graphql-middleware` support
See original GitHub issueAdd out of the box support for GraphQL Middleware plugins.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:10 (2 by maintainers)
Top Results From Across the Web
graphql-middleware - npm
GraphQL Middleware lets you run arbitrary code before or after a resolver is invoked. It improves your code structure by enabling code reuse...
Read more >Integrating with Node.js middleware - Apollo GraphQL Docs
When integrating with middleware, first you initialize Apollo Server just like you always do, and then you call applyMiddleware . Here's a basic...
Read more >Authentication and Express Middleware - GraphQL
To use middleware with a GraphQL resolver, just use the middleware like you would with a normal Express app. The request object is...
Read more >Treating GraphQL directives as middleware - LogRocket Blog
Being based in Express, graphql-yoga supports field resolver middleware out of the box, implemented through the graphql-middleware package.
Read more >Use graphql-middleware for cross-cutting concerns | Medium
GraphQL best practices: Use graphql-middleware for cross-cutting concerns · Use a graphql logger middleware to delegate logging, avoid increased maintenance cost ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @Alvyre 👋
Since we still haven’t implemented this, you could use the alternative approach we mentioned above. Instead of supplying
resolvers
andtypeDefs
toserver
directly you can provide a schema that you build upfront. Something like this;You can find even more information about it in the link below. I hope this helps you solve the problem; I will try to make a PR by the end of the week 🤞
https://github.com/prisma/graphql-middleware#standalone-usage
@notrab yeah, you can use it with
makeExecutableSchema
and thenapplyMiddleware
like this;I believe it would be a lot more convenient though to have general support for it. I will try to make a PR in the coming days!
https://github.com/prisma/graphql-middleware#standalone-usage