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 am not sure that this is a good idea. I will need to think more about that tomorrow or if I even actually need to to this. But here is my idea dump right now for future reference.
My use case is that my custom cache key value is potentially complicated and would need:
a lambda/proc on multiple lines (not super elegant, but already possible?)
field:some_field,String,cache: {key: ->(obj){"#{obj.id}123blah"}}do
...
end
its own line, e.g.
field:calculated_field,Intdocache <complicatedcodeblockgoeshere>
end
or even its own method within the enclosing Type class.
where :custom_cache_key is first looked up in the instance of the enclosing type class that is defining this field (with respond_to?) and only then calls the parent object if it's not defined.
or just use Rails.cache.fetch blocks manually inside the resolver