import type { ExecutionResult } from 'graphql/execution' ; import { graphqlSync } from 'graphql' ; import { GraphQLString , GraphQLSchema , GraphQLObjectType } from 'graphql/type' ; const queryType = new GraphQLObjectType ( { name : 'Query' , fields : ( ) => ( { sayHi : { type : GraphQLString , args : { who : { type : GraphQLString , defaultValue : 'World' } } , resolve ( _root , args ) { return 'Hello ' + args . who ; } } } ) } ) ; const schema = new GraphQLSchema ( { query : queryType } ) ; const result = graphqlSync ( { schema , source : `
    query helloWho($who: String){
      test(who: $who)
    }
  ` , variableValues : { who : 'Dolly' } } ) ;