-
Notifications
You must be signed in to change notification settings - Fork 982
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
GraphQLHookOptions - add refetchQueries type. #1751
GraphQLHookOptions - add refetchQueries type. #1751
Conversation
Thanks for getting started on this @noire-munich. Can you please clean up the lint warnings? |
Done! |
Something I should have done myself a long time ago! 😁 Now that I can read the code I had a second look, and I'm afraid this doesn't scale very well. Next time someone is going to want to use some other option for useQuery or useMutation. And what if they're using some other graphql client (i.e. not Apollo Client) that might not even have I think we need to try to come up with a more generic solution. Probably something that uses actual generics. I've previously done some exploration around the whole gql client situation, and in doing so I've tried writing better types for everything. I don't have anything that's complete yet. But in one of my crazy experiments where I wrote my own gql client I did come up with something that's at least more flexible than what we have today with the types. Have a look here if you want https://github.com/redwoodjs/redwood/pull/1535/files#diff-dc5df66f19077795660133684ca45c60b2651b16962fc9cd3635f52bf03c661bR55 If it sounds like too much work, don't worry. I'll get around to fixing this myself eventually. Probably as soon as I run in to this problem myself in my own app. But if you do want to spend the time on it, that would be awesome! 🙂 No pressure either way. |
Agreed! Which is why I proposed to make This being said your solution is more elegant. I'm rather short on time lately, I can't block any PR related to this. |
No worries, someone else will get to it eventually 👍 That PR I linked was an experiment as part of this bigger idea: #1602 Your imput on that one is appreciated, if you have anything to add 🙂 |
@dac09 ok for this one in v0.25? |
I'm marking this as draft until @noire-munich, I or someone else implements a more generic solution than what's currently in this PR (see my previous comments for details) |
Looks clear to me. Shouldn't conflict with prerender |
@noire-munich super sorry we lost track of this one! @dac09 will #2485 handle this? |
Implemented in #2485 - thanks for this @noire-munich ! |
As seen on the forums,
refetchQueries
is not typed yet,https://community.redwoodjs.com/t/is-refetchqueries-deprecated/1791/9
PR for #1752