syntaxError.mjs 378 B

123456789101112
  1. import { GraphQLError } from './GraphQLError.mjs';
  2. /**
  3. * Produces a GraphQLError representing a syntax error, containing useful
  4. * descriptive information about the syntax error's position in the source.
  5. */
  6. export function syntaxError(source, position, description) {
  7. return new GraphQLError(`Syntax Error: ${description}`, {
  8. source,
  9. positions: [position],
  10. });
  11. }