Mirror: The small sibling of the graphql package, slimmed down for client-side libraries.

Apply fix (#23)

Changed files
+27 -3
alias
language
+26 -2
alias/language/parser.mjs
···
const _parseValue = makeParser(value);
const _parseType = makeParser(type);
-
export function parse(input) {
const result = _parse(input);
if (result == null) throw new GraphQLError('Syntax Error');
-
return result;
}
export function parseValue(input) {
···
const _parseValue = makeParser(value);
const _parseType = makeParser(type);
+
export function parse(input, options) {
const result = _parse(input);
if (result == null) throw new GraphQLError('Syntax Error');
+
if (options && options.noLocation) 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) {
+1 -1
package.json
···
{
"name": "graphql-web-lite",
"description": "graphql npm package slimmed down for client-side libraries",
-
"version": "15.5.1002",
"license": "MIT",
"private": true,
"workspaces": [
···
{
"name": "graphql-web-lite",
"description": "graphql npm package slimmed down for client-side libraries",
+
"version": "15.5.1003",
"license": "MIT",
"private": true,
"workspaces": [