public function parse(Source $source, array $options = []): DocumentNode
    {
        $this->lexer = $this->createLexer($source, $options);

        return $this->lexDocument();
    }
public function parse(Source $source, array $options = []): DocumentNode
    {
        $this->lexer = $this->createLexer($source, $options);

        return $this->lexDocument();
    }
public function parse ( Source $ source , array $ options = [ ] ) : DocumentNode { $ this -> lexer = $ this -> createLexer ( $ source , $ options ) ; return $ this -> lexDocument ( ) ; }
Given a GraphQL source, parses it into a Document.
Throws GraphQLError if a syntax error is encountered.

@inheritdoc
@throws SyntaxErrorException
@throws \ReflectionException
@throws InvariantException
Given a GraphQL source parses it into a Document . Throws GraphQLError if a syntax error is encountered .