From 7b5998b63d371c1b0f51acb032188554ce7dde81 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Wed, 31 Mar 2021 00:51:08 +1100 Subject: [PATCH] tweak --- source/index.js | 2 +- source/parse-query-tree.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/source/index.js b/source/index.js index 783d576..baf3f5b 100644 --- a/source/index.js +++ b/source/index.js @@ -19,7 +19,6 @@ const sineQL = (schema, { queryHandlers }, options = {}) => { try { //parse the query const tokens = parseInput(reqBody, true, options); - const queryTree = parseQueryTree(tokens, typeGraph, options); switch(tokens[0]) { //check for leading keywords @@ -32,6 +31,7 @@ const sineQL = (schema, { queryHandlers }, options = {}) => { //no leading keyword - regular query default: { + const queryTree = parseQueryTree(tokens, typeGraph, options); const result = await queryHandlers[queryTree.typeName](queryTree, typeGraph); if (options.debug) { diff --git a/source/parse-query-tree.js b/source/parse-query-tree.js index 140f82e..674292c 100644 --- a/source/parse-query-tree.js +++ b/source/parse-query-tree.js @@ -2,8 +2,6 @@ const parseQueryTree = (tokens, typeGraph, options) => { let current = 1; //primed - //TODO: check for top-level keywords - //get a token that matches a type if (!typeGraph[tokens[current - 1]]) { throw `Expected a type in the type graph (found ${tokens[current - 1]})`;