apollo
apollo copied to clipboard
`dataIdFromObject` is never called
Environment
- Operating System: Darwin
- Node Version: v18.17.1
- Nuxt Version: 3.7.4
- CLI Version: 3.9.0
- Nitro Version: 2.6.3
- Package Manager: [email protected]
- Builder: -
- User Config: runtimeConfig, alias, app, components, modules, i18n, apollo, plugins, css, vite
- Runtime Modules: @nuxtjs/[email protected], [email protected], @nuxtjs/[email protected], @vueuse/[email protected], @pinia/[email protected], @pinia-plugin-persistedstate/[email protected], ./modules/introspect
- Build Modules: -
Describe the bug
dataIdFromObject
is never called in inMemoryCacheOptions
and hence it's impossible to set fallback cache ids
Expected behaviour
to be able to create fallback cache ids with dataIdFromObject
Reproduction
Add dataIdFromObject
to inMemoryCacheOptions
and add debugger
or console logs and you'll see it never gets hit, you'll also notice if you use tools to view the client cache the cache ids are not altered by anything in this function
I've tried this with both useQuery
and useAsyncQuery
. I am able to override with individual typePolicies
but this is extremely brittle since this is a system wide change we need to make.
Additional context
No response
Logs
No response
Looks like there's been some progress on this in alpha 10, it is now being called, but it's still not quite working. I tried just calling return dataIdFromObject(object)
which should effectively leave cache ids as their defaults and things break without any specific errors exposed