nl_tokens: A helper for resolving the Node type in Relay .
pl_tokens: async function getNode ( typeName , resolveInfo , context , condition , dbCall , options = { } ) { // get the GraphQL type from the schema using the name const type = resolveInfo . schema . _typeMap [ typeName ] assert ( type , ` ${ typeName } ` ) assert ( <mask> . _typeConfig . sqlTable , ` ${ typeName } ` ) // we need to determine what the WHERE function should be let where = buildWhereFunction ( type , condition , options ) // our getGraphQLType expects every requested field to be in the schema definition. "node" isn't a parent of whatever type we're getting, so we'll just wrap that type in an object that LOOKS that same as a hypothetical Node type const fakeParentNode = { _fields : { node : { type , name : type . name . toLowerCase ( ) , where } } } const namespace = new AliasNamespace ( options . minify ) const sqlAST = { } const fieldNodes = resolveInfo . fieldNodes || resolveInfo . fieldASTs // uses the same underlying function as the main `joinMonster` queryAST . populateASTNode . call ( resolveInfo , fieldNodes [ 0 ] , fakeParentNode , sqlAST , namespace , 0 , options , context ) queryAST . pruneDuplicateSqlDeps ( sqlAST , namespace ) const { sql , shapeDefinition } = await compileSqlAST ( sqlAST , context , options ) const data = arrToConnection ( await handleUserDbCall ( dbCall , sql , sqlAST , shapeDefinition ) , sqlAST ) await nextBatch ( sqlAST , data , dbCall , context , options ) if ( ! data ) return data data . __type__ = type return data }