import { GraphQLScalarType , Kind , ValueNode } from 'graphql' ; import jexl from 'jexl' ; import Expression from 'jexl/dist/Expression' ; export const JexlExpressionScalar = new GraphQLScalarType ( { description : undefined , name : 'JexlExpression' , parseLiteral ( ast ) { if ( ast . kind === Kind . STRING ) { return jexl . createExpression ( ast . value ) ; } return null ; } , parseValue ( value ) { return jexl . createExpression ( value ) ; } , serialize ( value ) { return value [ '_exprStr' ] ; } , } ) ;