-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Is there a way to make queryVariables be available on reducer option? #939
Comments
@drFabio I think that was just an omission. It should be pretty simple to add, and I'm happy to help you with pointers if you would live to try making a PR 🙂 |
If no one is already on top of that I can try to make a pr on the weekend. |
So just to check if my line of reason is right @helfer. And the problem actually is just that I do not make that available to the reducer here since I only pass the currentResult and the action. Now if I got it right the only thing I would like to discuss is where to put it . Should we pass a third argument making someone that is experienced with the (result,action) way of redux to have a surprise. Or make a really unlikely key and put it on action? I am more of a fan of the later option and you guys already do those prefixed keys on that I would think on put APOLLO_QUERY_VARIABLES or something like that. |
Maybe tangentially related. It seems using multiple reducers on different queries may cause some bug. |
After a bit of head-scratching, I found this issue, I'm in a similar state:
And I can't find a way to access the query variables! |
There isn't currently a way . @Siyfion on this issue #903 it was made clear to me that the observeable query design would not suit my neeeds. (basically because I have multiple views of the same data on different sorts). It's been a while and I don't quite remember why but I remember realizing based on that issue + digging on the code I would not be able to get the query parameter on the reducer. Or at least it was out of my league |
Thought I'd save us all some time and create a PR. Hopefully it'll get looked at and pulled soon @drFabio! |
Should be all good now. |
Currently it seems that unlike updateQueries, the reducer option can't get the query variables on the update.
Was this by design? Is there a way to achieve it or it is a constraint of some sort?
One example of why this may be needed is this:
Thanks in advance
The text was updated successfully, but these errors were encountered: