Skip to content

Commit 312daa5

Browse files
IvanGoncharovleebyron
authored andcommitted
Switch introspection tests to graphqlSync (#1225)
1 parent b333b30 commit 312daa5

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/__tests__/starWarsIntrospection-test.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
import { expect } from 'chai';
1111
import { describe, it } from 'mocha';
1212
import { StarWarsSchema } from './starWarsSchema.js';
13-
import { graphql } from '../graphql';
13+
import { graphqlSync } from '../graphql';
1414

1515
describe('Star Wars Introspection Tests', () => {
1616
describe('Basic Introspection', () => {
17-
it('Allows querying the schema for types', async () => {
17+
it('Allows querying the schema for types', () => {
1818
const query = `
1919
query IntrospectionTypeQuery {
2020
__schema {
@@ -75,11 +75,11 @@ describe('Star Wars Introspection Tests', () => {
7575
],
7676
},
7777
};
78-
const result = await graphql(StarWarsSchema, query);
78+
const result = graphqlSync(StarWarsSchema, query);
7979
expect(result).to.deep.equal({ data: expected });
8080
});
8181

82-
it('Allows querying the schema for query type', async () => {
82+
it('Allows querying the schema for query type', () => {
8383
const query = `
8484
query IntrospectionQueryTypeQuery {
8585
__schema {
@@ -96,11 +96,11 @@ describe('Star Wars Introspection Tests', () => {
9696
},
9797
},
9898
};
99-
const result = await graphql(StarWarsSchema, query);
99+
const result = graphqlSync(StarWarsSchema, query);
100100
expect(result).to.deep.equal({ data: expected });
101101
});
102102

103-
it('Allows querying the schema for a specific type', async () => {
103+
it('Allows querying the schema for a specific type', () => {
104104
const query = `
105105
query IntrospectionDroidTypeQuery {
106106
__type(name: "Droid") {
@@ -113,11 +113,11 @@ describe('Star Wars Introspection Tests', () => {
113113
name: 'Droid',
114114
},
115115
};
116-
const result = await graphql(StarWarsSchema, query);
116+
const result = graphqlSync(StarWarsSchema, query);
117117
expect(result).to.deep.equal({ data: expected });
118118
});
119119

120-
it('Allows querying the schema for an object kind', async () => {
120+
it('Allows querying the schema for an object kind', () => {
121121
const query = `
122122
query IntrospectionDroidKindQuery {
123123
__type(name: "Droid") {
@@ -132,11 +132,11 @@ describe('Star Wars Introspection Tests', () => {
132132
kind: 'OBJECT',
133133
},
134134
};
135-
const result = await graphql(StarWarsSchema, query);
135+
const result = graphqlSync(StarWarsSchema, query);
136136
expect(result).to.deep.equal({ data: expected });
137137
});
138138

139-
it('Allows querying the schema for an interface kind', async () => {
139+
it('Allows querying the schema for an interface kind', () => {
140140
const query = `
141141
query IntrospectionCharacterKindQuery {
142142
__type(name: "Character") {
@@ -151,11 +151,11 @@ describe('Star Wars Introspection Tests', () => {
151151
kind: 'INTERFACE',
152152
},
153153
};
154-
const result = await graphql(StarWarsSchema, query);
154+
const result = graphqlSync(StarWarsSchema, query);
155155
expect(result).to.deep.equal({ data: expected });
156156
});
157157

158-
it('Allows querying the schema for object fields', async () => {
158+
it('Allows querying the schema for object fields', () => {
159159
const query = `
160160
query IntrospectionDroidFieldsQuery {
161161
__type(name: "Droid") {
@@ -220,11 +220,11 @@ describe('Star Wars Introspection Tests', () => {
220220
},
221221
};
222222

223-
const result = await graphql(StarWarsSchema, query);
223+
const result = graphqlSync(StarWarsSchema, query);
224224
expect(result).to.deep.equal({ data: expected });
225225
});
226226

227-
it('Allows querying the schema for nested object fields', async () => {
227+
it('Allows querying the schema for nested object fields', () => {
228228
const query = `
229229
query IntrospectionDroidNestedFieldsQuery {
230230
__type(name: "Droid") {
@@ -307,11 +307,11 @@ describe('Star Wars Introspection Tests', () => {
307307
],
308308
},
309309
};
310-
const result = await graphql(StarWarsSchema, query);
310+
const result = graphqlSync(StarWarsSchema, query);
311311
expect(result).to.deep.equal({ data: expected });
312312
});
313313

314-
it('Allows querying the schema for field args', async () => {
314+
it('Allows querying the schema for field args', () => {
315315
const query = `
316316
query IntrospectionQueryTypeQuery {
317317
__schema {
@@ -399,11 +399,11 @@ describe('Star Wars Introspection Tests', () => {
399399
},
400400
};
401401

402-
const result = await graphql(StarWarsSchema, query);
402+
const result = graphqlSync(StarWarsSchema, query);
403403
expect(result).to.deep.equal({ data: expected });
404404
});
405405

406-
it('Allows querying the schema for documentation', async () => {
406+
it('Allows querying the schema for documentation', () => {
407407
const query = `
408408
query IntrospectionDroidDescriptionQuery {
409409
__type(name: "Droid") {
@@ -418,7 +418,7 @@ describe('Star Wars Introspection Tests', () => {
418418
description: 'A mechanical creature in the Star Wars universe.',
419419
},
420420
};
421-
const result = await graphql(StarWarsSchema, query);
421+
const result = graphqlSync(StarWarsSchema, query);
422422
expect(result).to.deep.equal({ data: expected });
423423
});
424424
});

0 commit comments

Comments
 (0)