-
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
Proposal: Mutation/FetchMore-like query reducer after receiving results of a query #495
Comments
This mechanism could for example let the user control the update from a previous query state and also control how a refetch is merged into the store. |
Can you give me an example of when this would be useful? Is it only for sorting? I'd like to think about a few more use cases before settling on a design. |
For now, I only see sorting (what actually I would need it for) but I'll try to thing about other use cases. If we do that, I agree, it has to be useful but I'm sure there are some other cases where it could make sense too. |
tracking this in #506 |
We merged #506. |
@Slava thanks! |
In the recently introduced Mutation and pagination mechanisms, we have the possibility to apply a "reducer" on the query results. This allows for instance to merge mutation results inside of the store or concat and sort two lists (pagination).
However, there is currently no way of applying a function on the results when the query is created (for example for sorting). Yes, this could be achieved in a react component for example but I think that being able to transform query results after retrieval could be useful.
The text was updated successfully, but these errors were encountered: