Module: GraphQL::Cache
- Defined in:
- lib/graphql/cache.rb,
lib/graphql/cache/key.rb,
lib/graphql/cache/field.rb,
lib/graphql/cache/rails.rb,
lib/graphql/cache/fetcher.rb,
lib/graphql/cache/marshal.rb,
lib/graphql/cache/version.rb,
lib/graphql/cache/deconstructor.rb
Defined Under Namespace
Classes: Deconstructor, Fetcher, Field, Key, Marshal, Rails
Constant Summary collapse
- VERSION =
'0.6.0'.freeze
Class Attribute Summary collapse
-
.cache ⇒ Object
An object that must conform to the same API as ActiveSupport::Cache::Store.
-
.expiry ⇒ Integer
Global default cache key expiration time in seconds.
-
.logger ⇒ Logger
Logger instance to use when logging cache hits/misses.
-
.namespace ⇒ String
Global namespace for keys.
Class Method Summary collapse
-
.configure {|_self| ... } ⇒ Object
Provides for initializer syntax.
-
.use(schema_def, options: {}) ⇒ Object
Called by plugin framework in graphql-ruby to bootstrap necessary instrumentation and tracing tie-ins.
Class Attribute Details
.cache ⇒ Object
An object that must conform to the same API as ActiveSupport::Cache::Store
14 15 16 |
# File 'lib/graphql/cache.rb', line 14 def cache @cache end |
.expiry ⇒ Integer
Global default cache key expiration time in seconds.
18 19 20 |
# File 'lib/graphql/cache.rb', line 18 def expiry @expiry end |
.logger ⇒ Logger
Logger instance to use when logging cache hits/misses.
22 23 24 |
# File 'lib/graphql/cache.rb', line 22 def logger @logger end |
.namespace ⇒ String
Global namespace for keys
26 27 28 |
# File 'lib/graphql/cache.rb', line 26 def namespace @namespace end |
Class Method Details
.configure {|_self| ... } ⇒ Object
35 36 37 |
# File 'lib/graphql/cache.rb', line 35 def configure yield self end |
.use(schema_def, options: {}) ⇒ Object
Called by plugin framework in graphql-ruby to bootstrap necessary instrumentation and tracing tie-ins
47 48 49 50 |
# File 'lib/graphql/cache.rb', line 47 def self.use(schema_def, options: {}) fetcher = ::GraphQL::Cache::Fetcher.new schema_def.instrument(:field, fetcher) end |