src/Schema/AST/ASTHelper.php
public static function attachNodeInterfaceToObjectType(ObjectTypeDefinitionNode $objectType, DocumentAST $documentAST): DocumentAST
    {
        $objectType->interfaces = self::mergeNodeList(
            $objectType->interfaces,
            [
                Parser::parseType(
                    'Node',
                    ['noLocation' => true]
                ),
            ]
        );

        $globalIdFieldDefinition = PartialParser::fieldDefinition(
            config('lighthouse.global_id_field').': ID! @globalId'
        );
        $objectType->fields = $objectType->fields->merge([$globalIdFieldDefinition]);

        return $documentAST->setDefinition($objectType);
    }
public static function attachNodeInterfaceToObjectType(ObjectTypeDefinitionNode $objectType, DocumentAST $documentAST): DocumentAST
    {
        $objectType->interfaces = self::mergeNodeList(
            $objectType->interfaces,
            [
                Parser::parseType(
                    'Node',
                    ['noLocation' => true]
                ),
            ]
        );

        $globalIdFieldDefinition = PartialParser::fieldDefinition(
            config('lighthouse.global_id_field').': ID! @globalId'
        );
        $objectType->fields = $objectType->fields->merge([$globalIdFieldDefinition]);

        return $documentAST->setDefinition($objectType);
    }
public static function attachNodeInterfaceToObjectType ( ObjectTypeDefinitionNode $ objectType , DocumentAST $ documentAST ) : DocumentAST { $ objectType -> interfaces = self :: mergeNodeList ( $ objectType -> interfaces , [ Parser :: parseType ( 'Node' , [ 'noLocation' => true ] ) , ] ) ; $ globalIdFieldDefinition = PartialParser :: fieldDefinition ( config ( 'lighthouse.global_id_field' ) . ': ID! @globalId' ) ; $ objectType -> fields = $ objectType -> fields -> merge ( [ $ globalIdFieldDefinition ] ) ; return $ documentAST -> setDefinition ( $ objectType ) ; }
This adds an Interface called "Node" to an ObjectType definition.

@param  \GraphQL\Language\AST\ObjectTypeDefinitionNode  $objectType
@param  \Nuwave\Lighthouse\Schema\AST\DocumentAST  $documentAST
@return \Nuwave\Lighthouse\Schema\AST\DocumentAST
This adds an Interface called Node to an ObjectType definition .