src/Language/Parser.php
private function parseSchemaTypeExtension()
    {
        $start = $this->lexer->token;
        $this->expectKeyword('extend');
        $this->expectKeyword('schema');
        $directives     = $this->parseDirectives(true);
        $operationTypes = $this->peek(Token::BRACE_L)
            ? $this->many(
                Token::BRACE_L,
                [$this, 'parseOperationTypeDefinition'],
                Token::BRACE_R
            ) : [];
        if (count($directives) === 0 && count($operationTypes) === 0) {
            $this->unexpected();
        }

        return new SchemaTypeExtensionNode([
            'directives' => $directives,
            'operationTypes' => $operationTypes,
            'loc' => $this->loc($start),
        ]);
    }
private function parseSchemaTypeExtension()
    {
        $start = $this->lexer->token;
        $this->expectKeyword('extend');
        $this->expectKeyword('schema');
        $directives     = $this->parseDirectives(true);
        $operationTypes = $this->peek(Token::BRACE_L)
            ? $this->many(
                Token::BRACE_L,
                [$this, 'parseOperationTypeDefinition'],
                Token::BRACE_R
            ) : [];
        if (count($directives) === 0 && count($operationTypes) === 0) {
            $this->unexpected();
        }

        return new SchemaTypeExtensionNode([
            'directives' => $directives,
            'operationTypes' => $operationTypes,
            'loc' => $this->loc($start),
        ]);
    }
private function parseSchemaTypeExtension ( ) { $ start = $ this -> lexer -> token ; $ this -> expectKeyword ( 'extend' ) ; $ this -> expectKeyword ( 'schema' ) ; $ directives = $ this -> parseDirectives ( true ) ; $ operationTypes = $ this -> peek ( Token :: BRACE_L ) ? $ this -> many ( Token :: BRACE_L , [ $ this , 'parseOperationTypeDefinition' ] , Token :: BRACE_R ) : [ ] ; if ( count ( $ directives ) === 0 && count ( $ operationTypes ) === 0 ) { $ this -> unexpected ( ) ; } return new SchemaTypeExtensionNode ( [ 'directives' => $ directives , 'operationTypes' => $ operationTypes , 'loc' => $ this -> loc ( $ start ) , ] ) ; }
@return SchemaTypeExtensionNode

@throws SyntaxError
@return SchemaTypeExtensionNode