import { GraphQLScalarType } from 'graphql' ; import GraphQLJSON from 'graphql-type-json' ; import { Kind } from 'graphql/language' ; export const resolverMap = { Date : new GraphQLScalarType ( { name : 'Date' , description : 'Date custom scalar type' , parseValue ( value ) { return new Date ( value ) ; } , serialize ( value ) { return value . toISOString ( ) ; } , parseLiteral ( ast ) { if ( ast . kind === Kind . STRING ) { return new Date ( ast . value ) ; } return null ; } } ) , JSON : GraphQLJSON } ;