Skip to content

Commit

Permalink
Apply fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Nov 3, 2024
1 parent bb9f6a9 commit 2597a12
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion alias/language/parser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,29 @@ const _parseType = makeParser(type);
export function parse(input) {
const result = _parse(input);
if (result == null) throw new GraphQLError('Syntax Error');
return result;
let loc;
return {
...result,
set loc(_loc) {
loc = _loc;
},
get loc() {
if (!loc) {
loc = {
start: 0,
end: input.length,
startToken: undefined,
endToken: undefined,
source: {
body: input,
name: 'graphql-web-lite',
locationOffset: { line: 1, column: 1 },
},
};
}
return loc;
},
};
}

export function parseValue(input) {
Expand Down

0 comments on commit 2597a12

Please sign in to comment.