This commit is contained in:
2020-09-07 17:14:45 +10:00
parent 792ea6b23d
commit 553ae44dc1
3 changed files with 1430 additions and 5 deletions

1421
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,11 +7,16 @@
"doc": "docs" "doc": "docs"
}, },
"scripts": { "scripts": {
"start": "pm2 start server/server.js",
"restart": "pm2 restart server/server.js",
"stop": "pm2 stop server/server.js",
"list": "pm2 list",
"node": "node server/server.js" "node": "node server/server.js"
}, },
"author": "Kayne Ruse", "author": "Kayne Ruse",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"express": "^4.17.1" "express": "^4.17.1",
"pm2": "^4.4.1"
} }
} }

View File

@@ -229,7 +229,7 @@ const parseQuery = async (handler, tokens, pos, typeGraph, parent = null) => {
//eat the end bracket //eat the end bracket
if (tokens[pos - 1] !== '}') { if (tokens[pos - 1] !== '}') {
throw 'Expected \'}\' at the end of query (found ' + tokens[pos] + ')'; throw 'Expected \'}\' at the end of query (found ' + tokens[pos - 1] + ')';
} }
if (!handler[queryType]) { if (!handler[queryType]) {
@@ -311,10 +311,11 @@ const lexify = (body, allowStrings) => {
//anything else is a multi-character token //anything else is a multi-character token
const start = current; const start = current;
while(body[current - 1] && !/[{}"\s]/.test(body[current - 1])) { while(body[current] && !/[{}"\s]/.test(body[current])) {
console.log('advancing past', body[current]);
current++; current++;
} }
tokens.push(body.substring(start - 1, current - 1)); tokens.push(body.substring(start - 1, current));
break; break;
} }
} }