src/Language/Parser.php
private function parseTypeExtension()
    {
        $keywordToken = $this->lexer->lookahead();

        if ($keywordToken->kind === Token::NAME) {
            switch ($keywordToken->value) {
                case 'schema':
                    return $this->parseSchemaTypeExtension();
                case 'scalar':
                    return $this->parseScalarTypeExtension();
                case 'type':
                    return $this->parseObjectTypeExtension();
                case 'interface':
                    return $this->parseInterfaceTypeExtension();
                case 'union':
                    return $this->parseUnionTypeExtension();
                case 'enum':
                    return $this->parseEnumTypeExtension();
                case 'input':
                    return $this->parseInputObjectTypeExtension();
            }
        }

        throw $this->unexpected($keywordToken);
    }
private function parseTypeExtension()
    {
        $keywordToken = $this->lexer->lookahead();

        if ($keywordToken->kind === Token::NAME) {
            switch ($keywordToken->value) {
                case 'schema':
                    return $this->parseSchemaTypeExtension();
                case 'scalar':
                    return $this->parseScalarTypeExtension();
                case 'type':
                    return $this->parseObjectTypeExtension();
                case 'interface':
                    return $this->parseInterfaceTypeExtension();
                case 'union':
                    return $this->parseUnionTypeExtension();
                case 'enum':
                    return $this->parseEnumTypeExtension();
                case 'input':
                    return $this->parseInputObjectTypeExtension();
            }
        }

        throw $this->unexpected($keywordToken);
    }
private function parseTypeExtension ( ) { $ keywordToken = $ this -> lexer -> lookahead ( ) ; if ( $ keywordToken -> kind === Token :: NAME ) { switch ( $ keywordToken -> value ) { case 'schema' : return $ this -> parseSchemaTypeExtension ( ) ; case 'scalar' : return $ this -> parseScalarTypeExtension ( ) ; case 'type' : return $ this -> parseObjectTypeExtension ( ) ; case 'interface' : return $ this -> parseInterfaceTypeExtension ( ) ; case 'union' : return $ this -> parseUnionTypeExtension ( ) ; case 'enum' : return $ this -> parseEnumTypeExtension ( ) ; case 'input' : return $ this -> parseInputObjectTypeExtension ( ) ; } } throw $ this -> unexpected ( $ keywordToken ) ; }
TypeExtension :
- ScalarTypeExtension
- ObjectTypeExtension
- InterfaceTypeExtension
- UnionTypeExtension
- EnumTypeExtension
- InputObjectTypeDefinition

@return TypeExtensionNode

@throws SyntaxError
TypeExtension : - ScalarTypeExtension - ObjectTypeExtension - InterfaceTypeExtension - UnionTypeExtension - EnumTypeExtension - InputObjectTypeDefinition