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.
207 208 209 210 |
# File 'lib/graphql/query.rb', line 207 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
215 216 217 218 219 220 |
# File 'lib/graphql/query.rb', line 215 def call @instrumenters.each { |i| i.before_query(@query) } result = get_result @instrumenters.each { |i| i.after_query(@query) } result end |