Reduce parser-graphql size (#10903)
This commit is contained in:
1 parent
4d37ac46a3
commit
8f17187bf7
1 file changed
+2
-2
@@ -43,7 +43,7 @@ const parseOptions = {
|
||||
};
|
||||
|
||||
function createParseError(error) {
|
||||
const { GraphQLError } = require("graphql/error");
|
||||
const { GraphQLError } = require("graphql/error/GraphQLError");
|
||||
if (error instanceof GraphQLError) {
|
||||
const {
|
||||
message,
|
||||
@@ -58,7 +58,7 @@ function createParseError(error) {
|
||||
|
||||
function parse(text /*, parsers, opts*/) {
|
||||
// Inline the require to avoid loading all the JS if we don't use it
|
||||
const { parse } = require("graphql/language");
|
||||
const { parse } = require("graphql/language/parser");
|
||||
const { result: ast, error } = tryCombinations(
|
||||
() => parse(text, { ...parseOptions }),
|
||||
() =>
|
||||
|
||||
Reference in new issue
Block a user