Class: GraphQL::Query::ExecutionCall
- Inherits:
-
Object
- Object
- GraphQL::Query::ExecutionCall
- Defined in:
- lib/graphql/query.rb
Instance Method Summary collapse
-
#call ⇒ Hash
Check if the query is valid, and if it is, execute it, calling instrumenters along the way.
-
#initialize(query, instrumenters) ⇒ ExecutionCall
constructor
A new instance of ExecutionCall.
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
#call ⇒ Hash
Check if the query is valid, and if it is, execute it, calling instrumenters along the way
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 |