I\'m trying to understand where GraphQL is most suitable to use within a Microservice architecture.
There is some debate about having only 1 GraphQL schema that works as
As of 2019 the best way is to write microservises that implements apollo gateway specification and then glue together these services using a gateway following approach #1. The fastest way to build the gateway is a docker image like this one Then use docker-compose to start all the services concurrently:
version: '3'
services:
service1:
build: service1
service2:
build: service2
gateway:
ports:
- 80:80
image: xmorse/apollo-federation-gateway
environment:
- CACHE_MAX_AGE=5
- "FORWARD_HEADERS=Authorization, X-Custom-Header" # default is Authorization, pass '' to reset
- URL_0=http://service1
- URL_1=http://service2