We deploy backend services with GraphQL API in multiple AWS regions. The GraphQL schema is the same for each region, but the services serve region specific data. Apollo federation does not seem to address this topic, because we do not want to merge different schema. Our problem is also not about choosing the closest region. Clients choose a specific region to access data served by that region.
With REST, a reverse proxy could forward a request to the target region based on path parameters. In GraphQL however, all requests are targeting the same endpoint.
What is a good practice to route GraphQL requests to different regions, which are using the same schema but serving different content?
EDIT: maybe it is also important to note that we are using GraphQL subscriptions as well. It would be nice avoiding connections to multiple endpoints in the client – if possible.
Read more here: Source link