Module: GraphQL::FragmentCache::Railtie::Config

Defined in:
lib/graphql/fragment_cache/railtie.rb

Overview

Provides Rails-specific configuration, accessible through ‘Rails.application.config.graphql_fragment_cache`

Class Method Summary collapse

Class Method Details

.store=(store) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/graphql/fragment_cache/railtie.rb', line 12

def store=(store)
  # Handle both:
  #   store = :memory
  #   store = :mem_cache, ENV['MEMCACHE']
  if store.is_a?(Symbol) || store.is_a?(Array)
    store = ActiveSupport::Cache.lookup_store(store)
  end

  FragmentCache.cache_store = store
end