Class: GraphQL::Query::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/graph_ql/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

Constructor Details

#initialize(arbitrary_hash) ⇒ Context

Returns a new instance of Context.



75
76
77
# File 'lib/graph_ql/query.rb', line 75

def initialize(arbitrary_hash)
  @arbitrary_hash = arbitrary_hash
end

Instance Method Details

#[](key) ⇒ Object



79
80
81
# File 'lib/graph_ql/query.rb', line 79

def [](key)
  @arbitrary_hash[key]
end