You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 26, 2022. It is now read-only.
I noticed in testing that the cache sometimes automatically gets updated after insertions, but i don't know when the field in the cache gets updated, and when it doesn't.
For example, doing just puts seems to get me the old, cached value, but running inspect seems to give an updated value?
puts Rails.cache.fetch("GraphQL::Cache:Query:restaurants:ids:#{de_moete.id}").inspect doesn't seem to cache the value, but without the inspect it does seem to get cached?
The text was updated successfully, but these errors were encountered:
@Frederik-Baetens SOrry for the long delay in responding here. By default the gem will attempt to use cache_key_with_version or cache_key on the object. In a Rails environment this corresponds to the ActiveRecord implementations of these methods. As to why inspect has an effect on the caching behavior...I have no idea. I will look into why that may be the case. My gut says that fetch is likely not returning the flat value but some kind of wrapper 🤷♂️
Can you update here with the versions you are using for Rails, graphql-ruby, and graphql-cache?
Sorry for the late response, we aren't really looking into caching anymore, because we realized that our heaviest queries can't be cached anyways. But i do wish you good luck in solving this issue.
Maybe the other people that have liked my issue can provide you with some more context on exactly what they were doing when they had this issue.
I noticed in testing that the cache sometimes automatically gets updated after insertions, but i don't know when the field in the cache gets updated, and when it doesn't.
For example, doing just puts seems to get me the old, cached value, but running inspect seems to give an updated value?
puts Rails.cache.fetch("GraphQL::Cache:Query:restaurants:ids:#{de_moete.id}").inspect
doesn't seem to cache the value, but without the inspect it does seem to get cached?The text was updated successfully, but these errors were encountered: