Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jotai-coder opened this issue Feb 20, 2024 · 5 comments
Closed

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

jotai-coder opened this issue Feb 20, 2024 · 5 comments
Labels
awaiting response question Issues that have a question which should be addressed

Comments

@jotai-coder
Copy link

jotai-coder commented Feb 20, 2024

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 jotai-coder added the question Issues that have a question which should be addressed label Feb 20, 2024
@jotai-coder jotai-coder changed the title SchemaConfiguration.cacheKeyInfo(for:object:) not called? SchemaConfiguration.cacheKeyInfo(for:object:) never called? Feb 20, 2024
@calvincestari
Copy link
Member

@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.

@jotai-coder
Copy link
Author

@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?

@calvincestari
Copy link
Member

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.

@AnthonyMDev
Copy link
Contributor

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 AnthonyMDev closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
Copy link
Contributor

github-actions bot commented Mar 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response question Issues that have a question which should be addressed
Projects
None yet
Development

No branches or pull requests

3 participants