Skip to content

GraphQLGuide/mock-external-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 and querying with Playground

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

SpaceX query in Playground with mocked results

About

Use Apollo Server to mock an external schema

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published