Class: GraphQL::Query::Context
- Inherits:
-
Object
- Object
- GraphQL::Query::Context
- Defined in:
- lib/graphql/query/context.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
-
#initialize(values:) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(values:) ⇒ Context
Returns a new instance of Context.
7 8 9 |
# File 'lib/graphql/query/context.rb', line 7 def initialize(values:) @values = values end |
Instance Attribute Details
#ast_node ⇒ Object
Returns the value of attribute ast_node.
6 7 8 |
# File 'lib/graphql/query/context.rb', line 6 def ast_node @ast_node end |
#execution_strategy ⇒ Object
Returns the value of attribute execution_strategy.
6 7 8 |
# File 'lib/graphql/query/context.rb', line 6 def execution_strategy @execution_strategy end |
Instance Method Details
#[](key) ⇒ Object
11 12 13 |
# File 'lib/graphql/query/context.rb', line 11 def [](key) @values[key] end |