The generation of a cache key is always important, but even ...

The generation of a cache key is always important, but even more so with GraphQL. The dynamic nature of GraphQL queries is such that even a white space in the query could affect the key and cause a miss, even though it was the same query in the first place. A good cache key should generally contain at least: User information (if authenticated API). A query hash, which should be normalized as much as possible. The variables hash (we would not want queries with different variables to be cached as the same thing). The operation name A cache-busting element.

www.joshbeckman.org/notes/210672380