stackshareio/graphql-cache

Allow "cache: true" for interface types

Closed this issue · 2 comments

When I try to add cached: true on an interface I get unknown keyword: cache.

The underlying class used in an interface field is different maybe, which could be why it doesn't work.

@jeromedalbert I took a look and the reason it is not recognizing the custom metadata is because the graphql-cache field_class is only set on the base object type, not the base interface type. If you add:

field_class GraphQL::Cache::Field

to your base interface module, those fields will recognize the cache param.

I just pushed #47 that adds a clarifying note about this usage of field_class to the README.