Skip to content

Switch introspection tests to graphqlSync #1225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/__tests__/starWarsIntrospection-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { StarWarsSchema } from './starWarsSchema.js';
import { graphql } from '../graphql';
import { graphqlSync } from '../graphql';

describe('Star Wars Introspection Tests', () => {
describe('Basic Introspection', () => {
it('Allows querying the schema for types', async () => {
it('Allows querying the schema for types', () => {
const query = `
query IntrospectionTypeQuery {
__schema {
Expand Down Expand Up @@ -75,11 +75,11 @@ describe('Star Wars Introspection Tests', () => {
],
},
};
const result = await graphql(StarWarsSchema, query);
const result = graphqlSync(StarWarsSchema, query);
expect(result).to.deep.equal({ data: expected });
});

it('Allows querying the schema for query type', async () => {
it('Allows querying the schema for query type', () => {
const query = `
query IntrospectionQueryTypeQuery {
__schema {
Expand All @@ -96,11 +96,11 @@ describe('Star Wars Introspection Tests', () => {
},
},
};
const result = await graphql(StarWarsSchema, query);
const result = graphqlSync(StarWarsSchema, query);
expect(result).to.deep.equal({ data: expected });
});

it('Allows querying the schema for a specific type', async () => {
it('Allows querying the schema for a specific type', () => {
const query = `
query IntrospectionDroidTypeQuery {
__type(name: "Droid") {
Expand All @@ -113,11 +113,11 @@ describe('Star Wars Introspection Tests', () => {
name: 'Droid',
},
};
const result = await graphql(StarWarsSchema, query);
const result = graphqlSync(StarWarsSchema, query);
expect(result).to.deep.equal({ data: expected });
});

it('Allows querying the schema for an object kind', async () => {
it('Allows querying the schema for an object kind', () => {
const query = `
query IntrospectionDroidKindQuery {
__type(name: "Droid") {
Expand All @@ -132,11 +132,11 @@ describe('Star Wars Introspection Tests', () => {
kind: 'OBJECT',
},
};
const result = await graphql(StarWarsSchema, query);
const result = graphqlSync(StarWarsSchema, query);
expect(result).to.deep.equal({ data: expected });
});

it('Allows querying the schema for an interface kind', async () => {
it('Allows querying the schema for an interface kind', () => {
const query = `
query IntrospectionCharacterKindQuery {
__type(name: "Character") {
Expand All @@ -151,11 +151,11 @@ describe('Star Wars Introspection Tests', () => {
kind: 'INTERFACE',
},
};
const result = await graphql(StarWarsSchema, query);
const result = graphqlSync(StarWarsSchema, query);
expect(result).to.deep.equal({ data: expected });
});

it('Allows querying the schema for object fields', async () => {
it('Allows querying the schema for object fields', () => {
const query = `
query IntrospectionDroidFieldsQuery {
__type(name: "Droid") {
Expand Down Expand Up @@ -220,11 +220,11 @@ describe('Star Wars Introspection Tests', () => {
},
};

const result = await graphql(StarWarsSchema, query);
const result = graphqlSync(StarWarsSchema, query);
expect(result).to.deep.equal({ data: expected });
});

it('Allows querying the schema for nested object fields', async () => {
it('Allows querying the schema for nested object fields', () => {
const query = `
query IntrospectionDroidNestedFieldsQuery {
__type(name: "Droid") {
Expand Down Expand Up @@ -307,11 +307,11 @@ describe('Star Wars Introspection Tests', () => {
],
},
};
const result = await graphql(StarWarsSchema, query);
const result = graphqlSync(StarWarsSchema, query);
expect(result).to.deep.equal({ data: expected });
});

it('Allows querying the schema for field args', async () => {
it('Allows querying the schema for field args', () => {
const query = `
query IntrospectionQueryTypeQuery {
__schema {
Expand Down Expand Up @@ -399,11 +399,11 @@ describe('Star Wars Introspection Tests', () => {
},
};

const result = await graphql(StarWarsSchema, query);
const result = graphqlSync(StarWarsSchema, query);
expect(result).to.deep.equal({ data: expected });
});

it('Allows querying the schema for documentation', async () => {
it('Allows querying the schema for documentation', () => {
const query = `
query IntrospectionDroidDescriptionQuery {
__type(name: "Droid") {
Expand All @@ -418,7 +418,7 @@ describe('Star Wars Introspection Tests', () => {
description: 'A mechanical creature in the Star Wars universe.',
},
};
const result = await graphql(StarWarsSchema, query);
const result = graphqlSync(StarWarsSchema, query);
expect(result).to.deep.equal({ data: expected });
});
});
Expand Down