Class: GraphQL::Query::ExecutionCall

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

Instance Method Summary collapse

Constructor Details

#initialize(query, instrumenters) ⇒ ExecutionCall

Returns a new instance of ExecutionCall.



232
233
234
235
# File 'lib/graphql/query.rb', line 232

def initialize(query, instrumenters)
  @query = query
  @instrumenters = instrumenters
end

Instance Method Details

#callHash

Check if the query is valid, and if it is, execute it, calling instrumenters along the way

Returns:

  • (Hash)

    The GraphQL response



240
241
242
243
244
245
# File 'lib/graphql/query.rb', line 240

def call
  @instrumenters.each { |i| i.before_query(@query) }
  result = get_result
  @instrumenters.each { |i| i.after_query(@query) }
  result
end