11/* @flow */
22/* eslint-disable no-unused-expressions, no-template-curly-in-string */
33
4- import {
5- GraphQLString ,
6- GraphQLFloat ,
7- GraphQLBoolean ,
8- GraphQLList ,
9- GraphQLEnumType ,
10- GraphQLSchema ,
11- GraphQLObjectType ,
12- graphql ,
13- } from 'graphql' ;
14- import { GraphQLDate , GraphQLBuffer , GraphQLGeneric , GraphQLJSON } from 'graphql-compose' ;
4+ import { GraphQLDate , GraphQLBuffer , GraphQLGeneric , GraphQLJSON , graphql } from 'graphql-compose' ;
155import { UserModel } from '../__mocks__/userModel' ;
166import {
177 deriveComplexType ,
@@ -29,6 +19,16 @@ import {
2919import { composeWithMongoose } from '../composeWithMongoose' ;
3020import GraphQLMongoID from '../types/mongoid' ;
3121
22+ const {
23+ GraphQLString,
24+ GraphQLFloat,
25+ GraphQLBoolean,
26+ GraphQLList,
27+ GraphQLEnumType,
28+ GraphQLSchema,
29+ GraphQLObjectType,
30+ } = graphql ;
31+
3232describe ( 'fieldConverter' , ( ) => {
3333 const fields = getFieldsFromModel ( UserModel ) ;
3434 const fieldNames = Object . keys ( fields ) ;
@@ -197,7 +197,7 @@ describe('fieldConverter', () => {
197197 name : 'Test empty subDoc' ,
198198 } ) ;
199199 await user . save ( ) ;
200- const result = await graphql (
200+ const result = await graphql . graphql (
201201 schema ,
202202 `{
203203 user(_id: "${ user . _id } ") {
@@ -239,7 +239,7 @@ describe('fieldConverter', () => {
239239 subDoc : { field2 : { field21 : 'ok' } } ,
240240 } ) ;
241241 await user2 . save ( ) ;
242- const result2 = await graphql (
242+ const result2 = await graphql . graphql (
243243 schema ,
244244 `{
245245 user(_id: "${ user2 . _id } ") {
@@ -322,7 +322,7 @@ describe('fieldConverter', () => {
322322 someDynamic
323323 }
324324 }` ;
325- const result = await graphql ( schema , query ) ;
325+ const result = await graphql . graphql ( schema , query ) ;
326326 expect ( result . data . user . name ) . toBe ( user . name ) ;
327327 expect ( result . data . user . someDynamic ) . toEqual ( user . someDynamic ) ;
328328 } ) ;
0 commit comments