mirror of
https://github.com/Ratstail91/sineQL.git
synced 2025-11-29 02:34:28 +11:00
Added error check
This commit is contained in:
@@ -47,6 +47,11 @@ const readBlock = (tokens, current, superType, typeGraph, options) => {
|
||||
console.log(`Trying to process field ${fieldName}`);
|
||||
}
|
||||
|
||||
//if the field is not present in the type
|
||||
if (!typeGraph[superType][fieldName]) {
|
||||
throw `Unexpected field name ${fieldName} in type ${superType}`;
|
||||
}
|
||||
|
||||
//if the field is non-scalar, read the sub-block
|
||||
if (!typeGraph[typeGraph[superType][fieldName].typeName].scalar) {
|
||||
//recurse
|
||||
|
||||
Reference in New Issue
Block a user