import { GraphQLID , GraphQLNonNull , GraphQLObjectType , GraphQLSchema , GraphQLString , } from 'graphql' ; import { mutationWithClientMutationId } from 'graphql-relay' ; const doStuff = mutationWithClientMutationId ( { name : 'DoStuff' , inputFields : { name : { type : GraphQLNonNull ( GraphQLString ) } , } , outputFields : { result : { type : GraphQLString } , } , mutateAndGetPayload : ( { name } ) => { return { result : `you did it ${ name }` } ; } , } ) ; const mutation = new GraphQLObjectType ( { name : 'Mutation' , fields : { doStuff } , } ) ; const query = new GraphQLObjectType ( { name : 'Query' , fields : { dummy : { type : GraphQLID } } , } ) ; export default new GraphQLSchema ( { query : query , mutation } ) ;