diff options
Diffstat (limited to 'school/node_modules/graphql/error/syntaxError.js.flow')
-rw-r--r-- | school/node_modules/graphql/error/syntaxError.js.flow | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/school/node_modules/graphql/error/syntaxError.js.flow b/school/node_modules/graphql/error/syntaxError.js.flow new file mode 100644 index 0000000..cdddcc3 --- /dev/null +++ b/school/node_modules/graphql/error/syntaxError.js.flow @@ -0,0 +1,18 @@ +// @flow strict +import type { Source } from '../language/source'; + +import { GraphQLError } from './GraphQLError'; + +/** + * Produces a GraphQLError representing a syntax error, containing useful + * descriptive information about the syntax error's position in the source. + */ +export function syntaxError( + source: Source, + position: number, + description: string, +): GraphQLError { + return new GraphQLError(`Syntax Error: ${description}`, undefined, source, [ + position, + ]); +} |