apollo-ios icon indicating copy to clipboard operation
apollo-ios copied to clipboard

SchemaConfiguration.cacheKeyInfo(for:object:) never called?

Open jotai-coder opened this issue 1 year ago • 3 comments

Question

(version 1.7.0)

I'm trying to define custom cache keys for some of our custom scalars as described in the docs.

However, cacheKeyInfo(for:object:) on SchemaConfiguration is never called during execution of our queries, so we're getting the default cache key implementation.

The only path that I see for calling this is in: GraphQLExecutor.executeChildSelections(forObjectTypeFields:withRootType:onChildObject:accumulator:) Ultimately implemented in CacheKeyComputingExecutionSource extension. I'm sure I've missed something, but can't sort out what. Thanks.

jotai-coder avatar Feb 20 '24 05:02 jotai-coder

@jotai-coder where are you defining the custom cache key function? It must be in the SchemaConfiguration.swift file to be called correctly. If that is how you've set it up then please share a sample project demonstrating the issue that we can debug.

calvincestari avatar Feb 20 '24 17:02 calvincestari

@jotai-coder where are you defining the custom cache key function? It must be in the SchemaConfiguration.swift file to be called correctly. If that is how you've set it up then please share a sample project demonstrating the issue that we can debug.

Do you have a template project I could use as a starting point?

jotai-coder avatar Feb 22 '24 17:02 jotai-coder

You just need a simple project with a schema you can share. As long as it demonstrates the problem it doesn't need to be anything complicated.

calvincestari avatar Feb 22 '24 19:02 calvincestari

I'm closing this issue due to inactivity. If this is still unresolved, feel free to provide more information and we can re-open this, or create a new issue.

AnthonyMDev avatar Mar 08 '24 18:03 AnthonyMDev

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

github-actions[bot] avatar Mar 08 '24 18:03 github-actions[bot]