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.3.0'
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.
-
.force ⇒ Boolean
When truthy, override all caching (force evalutaion of resolvers).
-
.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 |
.force ⇒ Boolean
When truthy, override all caching (force evalutaion of resolvers)
22 23 24 |
# File 'lib/graphql/cache.rb', line 22 def force @force end |
.logger ⇒ Logger
Logger instance to use when logging cache hits/misses.
26 27 28 |
# File 'lib/graphql/cache.rb', line 26 def logger @logger end |
.namespace ⇒ String
Global namespace for keys
30 31 32 |
# File 'lib/graphql/cache.rb', line 30 def namespace @namespace end |
Class Method Details
.configure {|_self| ... } ⇒ Object
39 40 41 |
# File 'lib/graphql/cache.rb', line 39 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
52 53 54 55 |
# File 'lib/graphql/cache.rb', line 52 def self.use(schema_def, options: {}) fetcher = ::GraphQL::Cache::Fetcher.new schema_def.instrument(:field, fetcher) end |