Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/setchy/apollo-server-4-mocked-federation
An example of using Apollo Server 4 with a mock managed federation gateway
https://github.com/setchy/apollo-server-4-mocked-federation
apollo-federation apollo-gateway apollo-server graphql managed-federation mocks
Last synced: about 1 month ago
JSON representation
An example of using Apollo Server 4 with a mock managed federation gateway
- Host: GitHub
- URL: https://github.com/setchy/apollo-server-4-mocked-federation
- Owner: setchy
- Created: 2022-10-22T15:54:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-02T22:56:33.000Z (about 1 month ago)
- Last Synced: 2024-05-03T06:58:01.326Z (about 1 month ago)
- Topics: apollo-federation, apollo-gateway, apollo-server, graphql, managed-federation, mocks
- Language: TypeScript
- Homepage:
- Size: 467 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Lists
- awesome-graphql - Mocked Managed Federation - Apollo Server 4 - An example of how to mock a managed federation Supgraph using Apollo Server 4.x (Implementations / JavaScript/TypeScript)
README
# Apollo Server 4 Mocked Federation
> See [setchy/apollo-server-3-mocked-federation](https://github.com/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](https://github.com/apollographql/federation) powered by [apollo-server](https://github.com/apollographql/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 `subgraph` has been published to the schema registry for the below mentioned `APOLLO_KEY` and `APOLLO_GRAPH_REF` pair## Getting started
1. `cp .env.template .env`
1. Edit `.env` and set a valid `APOLLO_KEY` and `APOLLO_GRAPH_REF` pair
1. Run `npm install && npm run dev`