Class: GraphQL::Groups::PendingQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/groups/pending_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, aggregate, proc) ⇒ PendingQuery

Returns a new instance of PendingQuery.



10
11
12
13
14
# File 'lib/graphql/groups/pending_query.rb', line 10

def initialize(key, aggregate, proc)
  @key = Utils.wrap(key)
  @aggregate = Utils.wrap(aggregate)
  @query = proc
end

Instance Attribute Details

#aggregateObject (readonly)

Returns the value of attribute aggregate.



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

def aggregate
  @aggregate
end

#keyObject (readonly)

Returns the value of attribute key.



6
7
8
# File 'lib/graphql/groups/pending_query.rb', line 6

def key
  @key
end

#queryObject (readonly)

Returns the value of attribute query.



8
9
10
# File 'lib/graphql/groups/pending_query.rb', line 8

def query
  @query
end

Instance Method Details

#executeObject



16
17
18
19
# File 'lib/graphql/groups/pending_query.rb', line 16

def execute
  result = @query.call
  QueryResult.new(@key, @aggregate, result)
end