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 Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(arbitrary_hash) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(arbitrary_hash) ⇒ Context
Returns a new instance of Context.
55 56 57 |
# File 'lib/graphql/query.rb', line 55 def initialize(arbitrary_hash) @arbitrary_hash = arbitrary_hash end |
Instance Method Details
#[](key) ⇒ Object
59 60 61 |
# File 'lib/graphql/query.rb', line 59 def [](key) @arbitrary_hash[key] end |