There are three projects inside this repo. One is the federation gateway, which is served at port http://localhost:3001/graphql
the other two are the graphql node services, that are served at port http://localhost:6001/graphql
and http://localhost:6002/graphql
- register account in Apollo Studio
- go to
Dashboard
tab and create graph
- name your graph and select
supergraph
- update
schema:publish
cmd inpackage.json
andAPOLLO_KEY
in.env.local
in posts and users services
- checkout branch
git checkout schema-registry
- publish schemas
cd nest-post-service && npm install && npm run schema:publish
cd nest-user-service && npm install && npm run schema:publish
- click the operation tab in left side and update
APOLLO_KEY
ANDAPOLLO_GRAPH_REF
in each.env.local
file
- start 3 services
cd nest-federation-gateway && npm install && npm start
cd nest-post-service && npm install && npm start
cd nest-user-service && npm install && npm start
- checkout branch
git checkout build-federated-schema
- you have to start the posts and users service at first
cd nest-post-service && npm install && npm start
cd nest-user-service && npm install && npm start
- then start the federation gateway service
cd nest-federation-gateway && npm install && npm start
Feature | Schema Registry | Build Federated Schema |
---|---|---|
remove deployment dependency between gateway and graphql services | ✅ | |
federated schema will be updated in realtime if sub graph get updated (no need to redeploy gateway to update federated schema) | ✅ |
service | url |
---|---|
gateway | http://localhost:3001/graphql |
users | http://localhost:6001/graphql |
posts | http://localhost:6002/graphql |