graphql-ruby-fragment_cache icon indicating copy to clipboard operation
graphql-ruby-fragment_cache copied to clipboard

Fix warning on ActiveSupport::Cache.format_version

Open Drowze opened this issue 1 year ago • 0 comments

Fixes #114

Rail.application was always evaluating to nil before as the code wasn't running in an initializer.

I changed the approach slightly to be less intrusive: now we simply initialize the cache store with a non-deprecated serializer, instead of modifying the ActiveSupport.cache_format_version configuration.


NOTE: after my change, if the user is on Rails >= 7 and didn't configure ActiveSupport::Cache.format_version, if they manually change the store (e.g.: Rails.application.config.graphql_fragment_cache = :memory_store), that will raise a ActiveSupport warning. I believe this behaviour is appropriate - the user should set an appropriate cache_format_version before setting the cache store.

Drowze avatar Oct 16 '24 11:10 Drowze