GraphQL\Language\Parser::parseFragmentDefinition PHP Method

parseFragmentDefinition() public method

public parseFragmentDefinition ( ) : FragmentDefinitionNode
return GraphQL\Language\AST\FragmentDefinitionNode
    function parseFragmentDefinition()
    {
        $start = $this->lexer->token;
        $this->expectKeyword('fragment');
        $name = $this->parseFragmentName();
        $this->expectKeyword('on');
        $typeCondition = $this->parseNamedType();
        return new FragmentDefinitionNode(['name' => $name, 'typeCondition' => $typeCondition, 'directives' => $this->parseDirectives(), 'selectionSet' => $this->parseSelectionSet(), 'loc' => $this->loc($start)]);
    }