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

Query specific type policy #9974

Closed
DaniloNovakovic opened this issue Aug 2, 2022 · 3 comments
Closed

Query specific type policy #9974

DaniloNovakovic opened this issue Aug 2, 2022 · 3 comments

Comments

@DaniloNovakovic
Copy link

Hello guys.

We are trying to remove deprecated updateQuery usages in our application, however we are running into one issue which is that sometimes we have need to re-use same query but have different keyArgs for example depending on the place of usage.

So for example:
Page A - Wants to have first argument field as keyArg
Page B - Doesn't want to have first argument as field in keyArgs.

So what I was thinking is that it would be really cool if we could have "query" specific type policy.

Meaning for example:

useQuery(Document, {
   typePolicies: {
      ....   // type policies that would be local for this specific query
   }
}

Wondering if something like this makes sense?

@DaniloNovakovic
Copy link
Author

DaniloNovakovic commented Aug 18, 2022

Extra info: The reason why I brought it up is that you marked updateQuery as deprecated, meanwhile, to my knowledge, you haven't really provided a proper alternative to the "component/call specific" merging solution that updateQuery offered :P

Sure I could define typePolicies in my root component, but I don't see a way to handle nieche scenarios where I want certain components / parts of my app to merge data to cache (or read data from the cache) differently then the rest aside from something like having separate cache instance, making my own local caching solution for that component, or something similar

@DaniloNovakovic
Copy link
Author

DaniloNovakovic commented Jun 23, 2023

Turns out updateQuery is no longer deprecated so I am closing this comment

@DaniloNovakovic DaniloNovakovic closed this as not planned Won't fix, can't repro, duplicate, stale Jun 23, 2023
@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants