src/GraphQL.php
protected function buildAST(): DocumentAST
    {
        $schemaString = $this->schemaSourceProvider->getSchemaString();

        // Allow to register listeners that add in additional schema definitions.
        // This can be used by plugins to hook into the schema building process
        // while still allowing the user to add in their schema as usual.
        $additionalSchemas = (array) $this->eventDispatcher->dispatch(
            new BuildSchemaString($schemaString)
        );

        $documentAST = $this->astBuilder->build(
            implode(
                PHP_EOL,
                Arr::prepend($additionalSchemas, $schemaString)
            )
        );

        // Listeners may manipulate the DocumentAST that is passed by reference
        // into the ManipulateAST event. This can be useful for extensions
        // that want to programmatically change the schema.
        $this->eventDispatcher->dispatch(
            new ManipulateAST($documentAST)
        );

        return $documentAST;
    }
protected function buildAST(): DocumentAST
    {
        $schemaString = $this->schemaSourceProvider->getSchemaString();

        // Allow to register listeners that add in additional schema definitions.
        // This can be used by plugins to hook into the schema building process
        // while still allowing the user to add in their schema as usual.
        $additionalSchemas = (array) $this->eventDispatcher->dispatch(
            new BuildSchemaString($schemaString)
        );

        $documentAST = $this->astBuilder->build(
            implode(
                PHP_EOL,
                Arr::prepend($additionalSchemas, $schemaString)
            )
        );

        // Listeners may manipulate the DocumentAST that is passed by reference
        // into the ManipulateAST event. This can be useful for extensions
        // that want to programmatically change the schema.
        $this->eventDispatcher->dispatch(
            new ManipulateAST($documentAST)
        );

        return $documentAST;
    }
protected function buildAST ( ) : DocumentAST { $ schemaString = $ this -> schemaSourceProvider -> getSchemaString ( ) ; // Allow to register listeners that add in additional schema definitions. // This can be used by plugins to hook into the schema building process // while still allowing the user to add in their schema as usual. $ additionalSchemas = ( array ) $ this -> eventDispatcher -> dispatch ( new BuildSchemaString ( $ schemaString ) ) ; $ documentAST = $ this -> astBuilder -> build ( implode ( PHP_EOL , Arr :: prepend ( $ additionalSchemas , $ schemaString ) ) ) ; // Listeners may manipulate the DocumentAST that is passed by reference // into the ManipulateAST event. This can be useful for extensions // that want to programmatically change the schema. $ this -> eventDispatcher -> dispatch ( new ManipulateAST ( $ documentAST ) ) ; return $ documentAST ; }
Get the schema string and build an AST out of it.

@return \Nuwave\Lighthouse\Schema\AST\DocumentAST
Get the schema string and build an AST out of it .