mirror of
https://github.com/Ratstail91/sineQL.git
synced 2025-11-29 02:34:28 +11:00
Replaced tests with jest
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//build the tokens into a single object of types representing the initial query
|
||||
const parseQueryTree = (tokens, typeGraph, options) => {
|
||||
const parseQueryTree = (tokens, typeGraph, options = {}) => {
|
||||
let current = 1; //primed
|
||||
|
||||
//get a token that matches a type
|
||||
@@ -60,6 +60,9 @@ const readBlock = (tokens, current, superType, typeGraph, options) => {
|
||||
//insert the typename into the block
|
||||
block['typeName'] = typeGraph[superType][fieldName].typeName;
|
||||
|
||||
//insert the unique modifier if it's set
|
||||
block['unique'] = typeGraph[superType][fieldName].unique;
|
||||
|
||||
//insert into result
|
||||
result[fieldName] = block;
|
||||
|
||||
@@ -83,6 +86,9 @@ const readBlock = (tokens, current, superType, typeGraph, options) => {
|
||||
//save the typeGraph type into result
|
||||
result[fieldName] = JSON.parse(JSON.stringify( typeGraph[ typeGraph[superType][fieldName].typeName ] ));
|
||||
|
||||
//insert the unique modifier if it's set
|
||||
result[fieldName]['unique'] = typeGraph[superType][fieldName].unique;
|
||||
|
||||
//insert the block-level modifier signal
|
||||
if (modifier) {
|
||||
result[fieldName][modifier] = tokens[current++];
|
||||
|
||||
Reference in New Issue
Block a user