I'm transitioning to use apollo-server instead of graphql yoga. I don't know how to implement graphql shield permisions middlewares into apollo-server 2.0, are there any examples?
I saw there was one with apollo-server-lambda but im not sure how to do it if i would use the express version.
Hey @donedgardo 馃憢,
Thank you for asking such an interesting question. I would say you have two options; 1) You could wait until the PR for graphql-middleware gets merged into the Apollo-Server (apollographql/apollo-server#1799), or 2) use the workaround for applying middleware to schema. You can find more about that in the link below under the _Standalone usage_ section.
https://github.com/prisma/graphql-middleware#standalone-usage
I hope this answers your question! 馃檪
馃憤 Awsome!
Will share my solution.
https://gist.github.com/donedgardo/ed2d36f6e650991543e5a55c77cddc0d
Thanks for sharing! Let me know if you need any help with anything else 馃檪.
I was also in the similar situation, wanted to connect graphql-shield with apollo-server-lambda, but couldn't find a clear example.
After a few tries, I managed to connect everything via graphql-middleware. I put an example here: https://github.com/doitadrian/example-graphql-shield-apollo-server-lambda
Hope it helps 馃檪
@doitadrian this is perfect! Would you mind if I add it to the examples section?
Sure, be my guest :) @maticzav
Most helpful comment
I was also in the similar situation, wanted to connect
graphql-shieldwithapollo-server-lambda, but couldn't find a clear example.After a few tries, I managed to connect everything via
graphql-middleware. I put an example here: https://github.com/doitadrian/example-graphql-shield-apollo-server-lambdaHope it helps 馃檪