Describe the bug
When creating a stitched schema, if one of the services references from the stitching is unreachable, the service will not return any requests.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect this to fallback gracefully. If one service is unreachable, It shouldn't hose the entire gateway. This functionality is preventing me from launching this into production. Ideally I don't want to take down every client talking to my graph if one of the 10 services behind it isn't responding properly. Preferably, it should still return the schema and serve requests to the graphs that it can reach.
Desktop (please complete the following information):
Hi @teevans,
you can actually do this. The schema files in this case have to be provided as files with the gateway. In this scenario the gateway would only fetch the data from the GraphQL server but not the schema.
We will add more functionality around this with version 12.
and use something like polly as a circuit breaker with your httpclient factory.
We use AddSchemaFromFile from file to handle these cases. This also gives us another useful behavior in being able to opt into a subset of the remote schema.
Ultimately if you're using AddSchemaFromHttp the stitching layer can't build a schema to return till it actually gets the remote schema, if that's down then only a partial schema could be created which is probably worse since queries expecting the full schema would fail at query validation.
@nigel-sampson
if that's down then only a partial schema could be created which is probably worse since queries expecting the full schema would fail at query validation.
Exactly the point. The schema would be unpredictable leading to issues with other GraphQL tooling.
While AddSchemaFromHttp is nice for development on a local system AddSchemaFromFile is better in production scenarios since then we can create the schema as intended.
HI @teevans,
I will close this issue since I think the question has been answered.
Thank you all so much!
Most helpful comment
We use
AddSchemaFromFilefrom file to handle these cases. This also gives us another useful behavior in being able to opt into a subset of the remote schema.Ultimately if you're using
AddSchemaFromHttpthe stitching layer can't build a schema to return till it actually gets the remote schema, if that's down then only a partial schema could be created which is probably worse since queries expecting the full schema would fail at query validation.