GraphQL\Language\Parser::parseFieldDefinition PHP Method

parseFieldDefinition() public method

public parseFieldDefinition ( ) : FieldDefinitionNode
return GraphQL\Language\AST\FieldDefinitionNode
    function parseFieldDefinition()
    {
        $start = $this->lexer->token;
        $name = $this->parseName();
        $args = $this->parseArgumentDefs();
        $this->expect(Token::COLON);
        $type = $this->parseTypeReference();
        $directives = $this->parseDirectives();
        return new FieldDefinitionNode(['name' => $name, 'arguments' => $args, 'type' => $type, 'directives' => $directives, 'loc' => $this->loc($start)]);
    }