stackshareio/graphql-cache

Cache miss: (GraphQL::Cache:Tag:title:Tag:tags/10-20190522154014980856)

afuno opened this issue · 2 comments

afuno commented

I tried to cache the title:

class Types::TagType < Types::BaseObject
  field :id, ID, null: false
  field :title, String, null: false, cache: true
end

But in the console I get a lot of messages of this type:

Cache miss: (GraphQL::Cache:Tag:title:Tag:tags/10-20190522154014980856)

How to fix it?

Those are debug level log messages that the gem emits for easy distinction of what resolved the field in question. You can eliminate the messages by setting your Rails log level to something higher than DEBUG. That's assuming your question is just about the log messages themselves. If you're having issues with the cache always missing that's another issue. Does the message persist on the second resolution of the field (i.e. run the query in the console again)? Or does it say Cache hit: (GraphQL::Cache:Tag:title:Tag:tags/10-20190522154014980856)

@afuno Did my previous comment answer your question?