src/Schema/AST/DocumentAST.php
public function addFieldToQueryType(FieldDefinitionNode $field): self
    {
        $query = $this->queryTypeDefinition();
        $query->fields = ASTHelper::mergeNodeList($query->fields, [$field]);

        $this->setDefinition($query);

        return $this;
    }
public function addFieldToQueryType(FieldDefinitionNode $field): self
    {
        $query = $this->queryTypeDefinition();
        $query->fields = ASTHelper::mergeNodeList($query->fields, [$field]);

        $this->setDefinition($query);

        return $this;
    }
public function addFieldToQueryType ( FieldDefinitionNode $ field ) : self { $ query = $ this -> queryTypeDefinition ( ) ; $ query -> fields = ASTHelper :: mergeNodeList ( $ query -> fields , [ $ field ] ) ; $ this -> setDefinition ( $ query ) ; return $ this ; }
Add a single field to the query type.

@param  \GraphQL\Language\AST\FieldDefinitionNode  $field
@return $this
Add a single field to the query type .