You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
We're setting up a microservices landscape with a Gateway and private services in Laravel/GraphQL with Lighthouse. In our Gateway we do our authentication and authorization with passport, gates and policies for users. And of course with Lighthouse directives @auth and @can in our GraphQL schema in the Gateway.
Problem
Lighthouse can't stitch external graphql schema's/services out of the box, by my knowledge.
Question
So, what's the best way to consume the graphql services (Laravel with lighthouse) from the gateway (also Laravel with Lighthouse), so we can do authorization on every query, mutation and subscription in our gateway?
Solution
We know about the concept stitching in GraphQL, so you van stitch external graphQL schema's to one schema (for us the gateway graphQL schema). So we have one schema, and one document to see what's possible for frontend. This seams to me the best solution.
Alternative
Our alternative is to pass incoming requests for the Laravel GraphQL Lighthouse Gateway, and delegate it to the right GraphQL service(s) with a GrapQL request (with guzzle) in the resolve function. And pass the response of it back to the client through the Gateway. The downside of this, is many code and different GraphQL schema's instead of one.
The text was updated successfully, but these errors were encountered:
Deprecated: Federation is our replacement for schema stitching that enables developers to declaratively compose a distributed graph. Learn why in our blog post and how to migrate in the federation guide.
Description
We're setting up a microservices landscape with a Gateway and private services in Laravel/GraphQL with Lighthouse. In our Gateway we do our authentication and authorization with passport, gates and policies for users. And of course with Lighthouse directives @auth and @can in our GraphQL schema in the Gateway.
Problem
Lighthouse can't stitch external graphql schema's/services out of the box, by my knowledge.
Question
So, what's the best way to consume the graphql services (Laravel with lighthouse) from the gateway (also Laravel with Lighthouse), so we can do authorization on every query, mutation and subscription in our gateway?
Solution
We know about the concept stitching in GraphQL, so you van stitch external graphQL schema's to one schema (for us the gateway graphQL schema). So we have one schema, and one document to see what's possible for frontend. This seams to me the best solution.
Alternative
Our alternative is to pass incoming requests for the Laravel GraphQL Lighthouse Gateway, and delegate it to the right GraphQL service(s) with a GrapQL request (with guzzle) in the resolve function. And pass the response of it back to the client through the Gateway. The downside of this, is many code and different GraphQL schema's instead of one.
The text was updated successfully, but these errors were encountered: