Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Graphql-middleware with example gateway #173

Open
mdettelson opened this issue Nov 23, 2022 · 1 comment
Open

Using Graphql-middleware with example gateway #173

mdettelson opened this issue Nov 23, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@mdettelson
Copy link

mdettelson commented Nov 23, 2022

Hi there!

I am currently using this registry with the example managed gateway provided in the examples directory. I'd like to apply a GraphQL middleware (for authorization purposes) at the gateway level, but I have yet to find a place in the custom gateway code to apply my middleware to the schema. Would someone be able to point me in the right direction?

Thanks!

@tot-ra
Copy link
Owner

tot-ra commented Nov 23, 2022

hey @mdettelson, you're right, after 5.0.0 examples got simplified and use only apollo server directly.
Previously, in 4.x.x versions, apollo server was wrapped into express.
So that handler could intercept request context, check for cookies or headers and validate access.

https://github.com/pipedrive/graphql-schema-registry/blob/4.0.0/examples/gateway_service_managed_federation/index.js#LL49C33-L49C51

If you manage to bring it back, do share an example for others too :)

@tot-ra tot-ra added the documentation Improvements or additions to documentation label Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants