Method: GraphQL::Query::Context#initialize

Defined in:
lib/graphql/query/context.rb

#initialize(query:, values:) ⇒ Context

Make a new context which delegates key lookup to values

Parameters:

  • query (GraphQL::Query)

    the query who owns this context

  • values (Hash)

    A hash of arbitrary values which will be accessible at query-time



43
44
45
46
47
48
49
50
# File 'lib/graphql/query/context.rb', line 43

def initialize(query:, values:)
  @query = query
  @schema = query.schema
  @values = values || {}
  @errors = []
  @warden = query.warden
  @path = []
end