Class: GraphQL::Groups::Schema::AggregateField

Inherits:
Schema::Field
  • Object
show all
Defined in:
lib/graphql/groups/schema/aggregate_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query_method:, **kwargs, &definition_block) ⇒ AggregateField

Returns a new instance of AggregateField.



9
10
11
12
# File 'lib/graphql/groups/schema/aggregate_field.rb', line 9

def initialize(query_method:, **kwargs, &definition_block)
  @query_method = query_method
  super(**kwargs, &definition_block)
end

Instance Attribute Details

#own_attributesObject (readonly)

Returns the value of attribute own_attributes.



7
8
9
# File 'lib/graphql/groups/schema/aggregate_field.rb', line 7

def own_attributes
  @own_attributes
end

#query_methodObject (readonly)

Returns the value of attribute query_method.



7
8
9
# File 'lib/graphql/groups/schema/aggregate_field.rb', line 7

def query_method
  @query_method
end

Instance Method Details

#attribute(attribute) ⇒ Object



14
15
16
17
# File 'lib/graphql/groups/schema/aggregate_field.rb', line 14

def attribute(attribute)
  @own_attributes ||= []
  @own_attributes += Array.wrap(attribute)
end