Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

"cache if" feature #56

@jeromedalbert

Description

@jeromedalbert

Similar to Rails views:

- cache_if (current_user.nil?) do

And actionpack-action_caching:

caches_action :show, if: -> { current_user.nil? }

It would be nice to be able to do something like this in graphql-cache:

field :calculated_field, Int, cache: { if: -> { current_user.nil? } }

Although the double-brackets might feel awkward, so it might look cleaner to do

field :calculated_field, Int do
  cache if: -> { current_user.nil? }
end

(which is related to my second bullet point on #52 referring to the ability to have cache on its own line)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions