Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(globalId, context, resolveInfo) => {
// parse the globalID
const { type, id } = fromGlobalId(globalId)
// helper method for getting Nodes from the DB, similar to the parent function.
// also need to pass it the type name and a where function
return joinMonster.getNode(type, resolveInfo, context, parseInt(id), sql => dbCall(sql, database, context), options)
},
// this function determines the type. `joinMonster` figures it out for you and attaches the type to the result in the "__type__" property
getBoard: (parent, args, { models }, info) =>
joinMonster(info, args, sql =>
models.sequelize.query(sql, { type: models.sequelize.QueryTypes.SELECT }),
),
allBoards: (parent, args, { models }, info) =>
resolve: (parent, args, context, resolveInfo) => {
return joinMonster(resolveInfo, context, sql => dbCall(sql, database, context), options)
}
}
getStudent: (parent, args, { models }, info) =>
joinMonster.default(info, args, sql =>
models.sequelize.query(sql, { type: models.sequelize.QueryTypes.SELECT }),
),
},
getSubject: (parent, args, { models }, info) =>
joinMonster.default(info, args, sql =>
models.sequelize.query(sql, { type: models.sequelize.QueryTypes.SELECT }),
),
},
user(parent, args, ctx, resolveInfo) {
return joinMonster(resolveInfo, ctx, sql => {
return db.all(sql)
}, { dialect: 'sqlite3' })
}
},