module GraphQL::ResultCache

Constants

VERSION

Attributes

cache[RW]
cache_write_options[RW]
client_hash[RW]

to expire the cache when client hash changes, should be a proc. eg: c.client_hash = -> { Rails.cache.read(:deploy_version) }

except[RW]

global condition, skip the cache when the value is true, should be a proc.

expires_in[RW]
logger[RW]
namespace[RW]

Public Class Methods

configure() { |self| ... } click to toggle source

“` GraphQL::ResultCache.configure do |c|

c.namespace = "GraphQL:Result"
c.expires_in = 1.hour
c.client_hash = -> { Rails.cache.read(:deploy_version) }

end “`

# File lib/graphql/result_cache.rb, line 31
def configure
  yield self
end
use(schema_def, options: {}) click to toggle source
# File lib/graphql/result_cache.rb, line 40
def self.use(schema_def, options: {})
  schema_def.instrument(:field, ::GraphQL::ResultCache::FieldInstrument.new)
end