Class: GraphQL::ResultCache::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/result_cache/key.rb

Instance Method Summary collapse

Constructor Details

#initialize(obj:, args:, ctx:, key: nil) ⇒ Key

Returns a new instance of Key.



4
5
6
7
8
9
# File 'lib/graphql/result_cache/key.rb', line 4

def initialize obj:, args:, ctx:, key: nil
  @obj = obj
  @args = args
  @ctx = ctx
  @key = key
end

Instance Method Details

#to_sObject



11
12
13
14
15
16
17
18
19
# File 'lib/graphql/result_cache/key.rb', line 11

def to_s
  @to_s ||= [
      ::GraphQL::ResultCache.namespace,
      path_clause,
      args_clause,
      object_clause,
      client_hash_clause
  ].flatten.compact.join(':')
end