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

dataIdFromObject is never called #569

Open
ssyberg opened this issue Nov 16, 2023 · 1 comment
Open

dataIdFromObject is never called #569

ssyberg opened this issue Nov 16, 2023 · 1 comment
Assignees
Labels

Comments

@ssyberg
Copy link

ssyberg commented Nov 16, 2023

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: yarn@1.22.19
  • Builder: -
  • User Config: runtimeConfig, alias, app, components, modules, i18n, apollo, plugins, css, vite
  • Runtime Modules: @nuxtjs/apollo@5.0.0-alpha.7, nuxt-vitest@0.8.7, @nuxtjs/i18n@8.0.0-rc.5, @vueuse/nuxt@10.4.1, @pinia/nuxt@0.4.11, @pinia-plugin-persistedstate/nuxt@1.2.0, ./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

@ssyberg ssyberg added the bug label Nov 16, 2023
@Diizzayy Diizzayy self-assigned this Nov 16, 2023
@ssyberg
Copy link
Author

ssyberg commented Dec 11, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants