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