I remember why I stopped working on this, read more

it's because the query parser is impossible to understand, and the handlers
are too long for this to be usable. It's a nice idea, but I can't do this
while drinking.
This commit is contained in:
2021-01-19 01:50:14 +11:00
parent 9ac32e918c
commit 128a42aaa6
9 changed files with 127 additions and 151 deletions

View File

@@ -53,7 +53,7 @@ const parseQuery = async (handler, tokens, pos, typeGraph, parent = null, superM
//push the scalar object to the queryFields
scalarFields.push({ typeName: typeGraph[superType][tokens[pos - 1]].typeName, name: tokens[pos - 1], filter: matching ? tokens[pos++] : null });
//if I am a scalar child of a match amd I do not match
//if I am a scalar child of a match and I do not match
if (parent && superMatching && !matching) {
throw 'Broken match chain in scalar type ' + tokens[pos - 1];
}
@@ -114,4 +114,4 @@ const parseQuery = async (handler, tokens, pos, typeGraph, parent = null, superM
return [results, pos];
};
module.exports = parseQuery;
module.exports = parseQuery;