Skip to content

Instantly share code, notes, and snippets.

@m14t
Created October 23, 2018 01:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m14t/45794fd7732d6eb90ce2217152309625 to your computer and use it in GitHub Desktop.
Save m14t/45794fd7732d6eb90ce2217152309625 to your computer and use it in GitHub Desktop.
Assert that your GraphQL schema can execute the introspectionQuery
const { execute, introspectionQuery, parse } = require('graphql');
const { schema } = require('../index');
describe('graphql', () => {
describe('index', () => {
describe('schema', () => {
it('should be a an object', () => {
expect(typeof schema).toBe('object');
});
it('should be able to execute the introspectionQuery', () =>
execute(schema, parse(introspectionQuery)));
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment