An open API service indexing awesome lists of open source software.

https://github.com/graphqlguide/mock-external-schema

Use Apollo Server to mock an external schema
https://github.com/graphqlguide/mock-external-schema

Last synced: 7 months ago
JSON representation

Use Apollo Server to mock an external schema

Awesome Lists containing this project

README

          

Mock any GraphQL schema. All you need is a `schema.json` or the URL of a GraphQL server that has introspection enabled.

Steps:

- Update the schema to the one you want by either:
- Replacing `schema.json`, or
- Replacing `https://api.spacex.land/graphql` in `package.json` and running `npm run update-schema`
- Running `npm start`
- Opening [localhost:4000](http://localhost:4000) and querying with Playground

Mocking docs: https://www.apollographql.com/docs/apollo-server/testing/mocking/

![SpaceX query in Playground with mocked results](https://www.dropbox.com/s/333z463raj3bbic/Screenshot%202020-02-13%2001.36.49.png?raw=1)