Class: GraphQL::Query::Context
- Inherits:
-
Object
- Object
- GraphQL::Query::Context
- Defined in:
- lib/graphql/query.rb
Overview
Expose some query-specific info to field resolve functions. It delegates ‘[]` to the hash that’s passed to ‘GraphQL::Query#initialize`.
Instance Attribute Summary collapse
-
#ast_node ⇒ Object
Returns the value of attribute ast_node.
-
#execution_strategy ⇒ Object
Returns the value of attribute execution_strategy.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #async(&block) ⇒ Object
-
#initialize(values:) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(values:) ⇒ Context
Returns a new instance of Context.
56 57 58 |
# File 'lib/graphql/query.rb', line 56 def initialize(values:) @values = values end |
Instance Attribute Details
#ast_node ⇒ Object
Returns the value of attribute ast_node.
55 56 57 |
# File 'lib/graphql/query.rb', line 55 def ast_node @ast_node end |
#execution_strategy ⇒ Object
Returns the value of attribute execution_strategy.
55 56 57 |
# File 'lib/graphql/query.rb', line 55 def execution_strategy @execution_strategy end |
Instance Method Details
#[](key) ⇒ Object
60 61 62 |
# File 'lib/graphql/query.rb', line 60 def [](key) @values[key] end |
#async(&block) ⇒ Object
64 65 66 |
# File 'lib/graphql/query.rb', line 64 def async(&block) execution_strategy.async(block) end |