src/Schema/AST/DocumentAST.php
public static function fromSource(string $schema): self
    {
        try {
            return new static(
                Parser::parse(
                    $schema,
                    // Ignore location since it only bloats the AST
                    ['noLocation' => true]
                )
            );
        } catch (SyntaxError $syntaxError) {
            // Throw our own error class instead, since otherwise a schema definition
            // error would get rendered to the Client.
            throw new ParseException(
                $syntaxError->getMessage()
            );
        }
    }
public static function fromSource(string $schema): self
    {
        try {
            return new static(
                Parser::parse(
                    $schema,
                    // Ignore location since it only bloats the AST
                    ['noLocation' => true]
                )
            );
        } catch (SyntaxError $syntaxError) {
            // Throw our own error class instead, since otherwise a schema definition
            // error would get rendered to the Client.
            throw new ParseException(
                $syntaxError->getMessage()
            );
        }
    }
public static function fromSource ( string $ schema ) : self { try { return new static ( Parser :: parse ( $ schema , // Ignore location since it only bloats the AST [ 'noLocation' => true ] ) ) ; } catch ( SyntaxError $ syntaxError ) { // Throw our own error class instead, since otherwise a schema definition // error would get rendered to the Client. throw new ParseException ( $ syntaxError -> getMessage ( ) ) ; } }
Create a new DocumentAST instance from a schema.

@param  string  $schema
@return static

@throws \Nuwave\Lighthouse\Exceptions\ParseException
Create a new DocumentAST instance from a schema .