Module: GraphQL::ResultCache
- Defined in:
- lib/graphql/result_cache.rb,
lib/graphql/result_cache/key.rb,
lib/graphql/result_cache/field.rb,
lib/graphql/result_cache/rails.rb,
lib/graphql/result_cache/result.rb,
lib/graphql/result_cache/version.rb,
lib/graphql/result_cache/callback.rb,
lib/graphql/result_cache/condition.rb,
lib/graphql/result_cache/context_config.rb,
lib/graphql/result_cache/field_instrument.rb
Defined Under Namespace
Classes: Callback, Condition, ContextConfig, Field, FieldInstrument, Key, Rails, Result
Constant Summary collapse
- VERSION =
'0.1.2'
Class Attribute Summary collapse
-
.cache ⇒ Object
Returns the value of attribute cache.
-
.client_hash ⇒ Object
to expire the cache when client hash changes, should be a proc.
-
.expires_in ⇒ Object
Returns the value of attribute expires_in.
-
.introspection ⇒ Object
(also: introspection?)
Returns the value of attribute introspection.
-
.logger ⇒ Object
Returns the value of attribute logger.
-
.namespace ⇒ Object
Returns the value of attribute namespace.
Class Method Summary collapse
-
.configure {|_self| ... } ⇒ Object
“‘ GraphQL::ResultCache.configure do |c| c.namespace = “GraphQL:Result” c.expires_in = 1.hour c.client_hash = -> { Rails.cache.read(:deploy_version) } end “`.
- .use(schema_def, options: {}) ⇒ Object
Class Attribute Details
.cache ⇒ Object
Returns the value of attribute cache.
12 13 14 |
# File 'lib/graphql/result_cache.rb', line 12 def cache @cache end |
.client_hash ⇒ Object
to expire the cache when client hash changes, should be a proc. eg: c.client_hash = -> { Rails.cache.read(:deploy_version) }
17 18 19 |
# File 'lib/graphql/result_cache.rb', line 17 def client_hash @client_hash end |
.expires_in ⇒ Object
Returns the value of attribute expires_in.
10 11 12 |
# File 'lib/graphql/result_cache.rb', line 10 def expires_in @expires_in end |
.introspection ⇒ Object Also known as: introspection?
Returns the value of attribute introspection.
19 20 21 |
# File 'lib/graphql/result_cache.rb', line 19 def introspection @introspection end |
.logger ⇒ Object
Returns the value of attribute logger.
13 14 15 |
# File 'lib/graphql/result_cache.rb', line 13 def logger @logger end |
.namespace ⇒ Object
Returns the value of attribute namespace.
11 12 13 |
# File 'lib/graphql/result_cache.rb', line 11 def namespace @namespace end |
Class Method Details
.configure {|_self| ... } ⇒ Object
29 30 31 |
# File 'lib/graphql/result_cache.rb', line 29 def configure yield self end |
.use(schema_def, options: {}) ⇒ Object
39 40 41 |
# File 'lib/graphql/result_cache.rb', line 39 def self.use(schema_def, options: {}) schema_def.instrument(:field, ::GraphQL::ResultCache::FieldInstrument.new) end |