syntaxError.js 501 B

12345678910111213141516171819
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true,
  4. });
  5. exports.syntaxError = syntaxError;
  6. var _GraphQLError = require('./GraphQLError.js');
  7. /**
  8. * Produces a GraphQLError representing a syntax error, containing useful
  9. * descriptive information about the syntax error's position in the source.
  10. */
  11. function syntaxError(source, position, description) {
  12. return new _GraphQLError.GraphQLError(`Syntax Error: ${description}`, {
  13. source,
  14. positions: [position],
  15. });
  16. }