10
10
import { expect } from 'chai' ;
11
11
import { describe , it } from 'mocha' ;
12
12
import { StarWarsSchema } from './starWarsSchema.js' ;
13
- import { graphql } from '../graphql' ;
13
+ import { graphqlSync } from '../graphql' ;
14
14
15
15
describe ( 'Star Wars Introspection Tests' , ( ) => {
16
16
describe ( 'Basic Introspection' , ( ) => {
17
- it ( 'Allows querying the schema for types' , async ( ) => {
17
+ it ( 'Allows querying the schema for types' , ( ) => {
18
18
const query = `
19
19
query IntrospectionTypeQuery {
20
20
__schema {
@@ -75,11 +75,11 @@ describe('Star Wars Introspection Tests', () => {
75
75
] ,
76
76
} ,
77
77
} ;
78
- const result = await graphql ( StarWarsSchema , query ) ;
78
+ const result = graphqlSync ( StarWarsSchema , query ) ;
79
79
expect ( result ) . to . deep . equal ( { data : expected } ) ;
80
80
} ) ;
81
81
82
- it ( 'Allows querying the schema for query type' , async ( ) => {
82
+ it ( 'Allows querying the schema for query type' , ( ) => {
83
83
const query = `
84
84
query IntrospectionQueryTypeQuery {
85
85
__schema {
@@ -96,11 +96,11 @@ describe('Star Wars Introspection Tests', () => {
96
96
} ,
97
97
} ,
98
98
} ;
99
- const result = await graphql ( StarWarsSchema , query ) ;
99
+ const result = graphqlSync ( StarWarsSchema , query ) ;
100
100
expect ( result ) . to . deep . equal ( { data : expected } ) ;
101
101
} ) ;
102
102
103
- it ( 'Allows querying the schema for a specific type' , async ( ) => {
103
+ it ( 'Allows querying the schema for a specific type' , ( ) => {
104
104
const query = `
105
105
query IntrospectionDroidTypeQuery {
106
106
__type(name: "Droid") {
@@ -113,11 +113,11 @@ describe('Star Wars Introspection Tests', () => {
113
113
name : 'Droid' ,
114
114
} ,
115
115
} ;
116
- const result = await graphql ( StarWarsSchema , query ) ;
116
+ const result = graphqlSync ( StarWarsSchema , query ) ;
117
117
expect ( result ) . to . deep . equal ( { data : expected } ) ;
118
118
} ) ;
119
119
120
- it ( 'Allows querying the schema for an object kind' , async ( ) => {
120
+ it ( 'Allows querying the schema for an object kind' , ( ) => {
121
121
const query = `
122
122
query IntrospectionDroidKindQuery {
123
123
__type(name: "Droid") {
@@ -132,11 +132,11 @@ describe('Star Wars Introspection Tests', () => {
132
132
kind : 'OBJECT' ,
133
133
} ,
134
134
} ;
135
- const result = await graphql ( StarWarsSchema , query ) ;
135
+ const result = graphqlSync ( StarWarsSchema , query ) ;
136
136
expect ( result ) . to . deep . equal ( { data : expected } ) ;
137
137
} ) ;
138
138
139
- it ( 'Allows querying the schema for an interface kind' , async ( ) => {
139
+ it ( 'Allows querying the schema for an interface kind' , ( ) => {
140
140
const query = `
141
141
query IntrospectionCharacterKindQuery {
142
142
__type(name: "Character") {
@@ -151,11 +151,11 @@ describe('Star Wars Introspection Tests', () => {
151
151
kind : 'INTERFACE' ,
152
152
} ,
153
153
} ;
154
- const result = await graphql ( StarWarsSchema , query ) ;
154
+ const result = graphqlSync ( StarWarsSchema , query ) ;
155
155
expect ( result ) . to . deep . equal ( { data : expected } ) ;
156
156
} ) ;
157
157
158
- it ( 'Allows querying the schema for object fields' , async ( ) => {
158
+ it ( 'Allows querying the schema for object fields' , ( ) => {
159
159
const query = `
160
160
query IntrospectionDroidFieldsQuery {
161
161
__type(name: "Droid") {
@@ -220,11 +220,11 @@ describe('Star Wars Introspection Tests', () => {
220
220
} ,
221
221
} ;
222
222
223
- const result = await graphql ( StarWarsSchema , query ) ;
223
+ const result = graphqlSync ( StarWarsSchema , query ) ;
224
224
expect ( result ) . to . deep . equal ( { data : expected } ) ;
225
225
} ) ;
226
226
227
- it ( 'Allows querying the schema for nested object fields' , async ( ) => {
227
+ it ( 'Allows querying the schema for nested object fields' , ( ) => {
228
228
const query = `
229
229
query IntrospectionDroidNestedFieldsQuery {
230
230
__type(name: "Droid") {
@@ -307,11 +307,11 @@ describe('Star Wars Introspection Tests', () => {
307
307
] ,
308
308
} ,
309
309
} ;
310
- const result = await graphql ( StarWarsSchema , query ) ;
310
+ const result = graphqlSync ( StarWarsSchema , query ) ;
311
311
expect ( result ) . to . deep . equal ( { data : expected } ) ;
312
312
} ) ;
313
313
314
- it ( 'Allows querying the schema for field args' , async ( ) => {
314
+ it ( 'Allows querying the schema for field args' , ( ) => {
315
315
const query = `
316
316
query IntrospectionQueryTypeQuery {
317
317
__schema {
@@ -399,11 +399,11 @@ describe('Star Wars Introspection Tests', () => {
399
399
} ,
400
400
} ;
401
401
402
- const result = await graphql ( StarWarsSchema , query ) ;
402
+ const result = graphqlSync ( StarWarsSchema , query ) ;
403
403
expect ( result ) . to . deep . equal ( { data : expected } ) ;
404
404
} ) ;
405
405
406
- it ( 'Allows querying the schema for documentation' , async ( ) => {
406
+ it ( 'Allows querying the schema for documentation' , ( ) => {
407
407
const query = `
408
408
query IntrospectionDroidDescriptionQuery {
409
409
__type(name: "Droid") {
@@ -418,7 +418,7 @@ describe('Star Wars Introspection Tests', () => {
418
418
description : 'A mechanical creature in the Star Wars universe.' ,
419
419
} ,
420
420
} ;
421
- const result = await graphql ( StarWarsSchema , query ) ;
421
+ const result = graphqlSync ( StarWarsSchema , query ) ;
422
422
expect ( result ) . to . deep . equal ( { data : expected } ) ;
423
423
} ) ;
424
424
} ) ;
0 commit comments