Worked on the schema code

This commit is contained in:
2020-09-05 00:05:56 +10:00
parent e9655f1055
commit 7fa4c56bcc
6 changed files with 43 additions and 31 deletions

View File

@@ -11,7 +11,7 @@ const database = require('./database.js');
//the handler routines
const handler = {
Book: (parent, scalars) => {
//takes an object which is the result of the parent query, if there is one { typeName: 'Author', scalars: [scalars], context: parentObject }
//takes an object which is the result of the parent query, if there is one { typeName: 'Author', scalars: [scalars] }
//takes an array of scalar types as objects: { typeName: 'String', name: 'title' }
//must return an array of objects containing the results
@@ -82,4 +82,4 @@ const handler = {
},
};
module.exports = handler;
module.exports = handler;