Apollo Server 4 Mocked Federation
October 22, 2022 ยท View on GitHub
See setchy/apollo-server-3-mocked-federation for an Apollo Server 3.x example
This repository contains a example of how to mock a managed federation Supergraph schema with apollo-gateway powered by apollo-server version 4.x.
Note: Since we are using managed federation, the mocked schema is the Supergraph schema from your Apollo Studio Schema Registry.
Assumptions
- You already have an Apollo Studio organization / account
- At least one
subgraphhas been published to the schema registry for the below mentionedAPOLLO_KEYandAPOLLO_GRAPH_REFpair
Getting started
cp .env.template .env- Edit
.envand set a validAPOLLO_KEYandAPOLLO_GRAPH_REFpair - Run
npm install && npm run dev