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

Proposal: Mutation/FetchMore-like query reducer after receiving results of a query #495

Closed
rricard opened this issue Aug 2, 2016 · 6 comments

Comments

@rricard
Copy link
Contributor

rricard commented Aug 2, 2016

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.

@rricard
Copy link
Contributor Author

rricard commented Aug 2, 2016

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.

@stubailo
Copy link
Contributor

stubailo commented Aug 2, 2016

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.

@rricard
Copy link
Contributor Author

rricard commented Aug 2, 2016

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.

@stubailo stubailo added the idea label Aug 2, 2016
@Slava
Copy link
Contributor

Slava commented Aug 4, 2016

tracking this in #506

@Slava
Copy link
Contributor

Slava commented Aug 4, 2016

We merged #506.

@Slava Slava closed this as completed Aug 4, 2016
@rricard
Copy link
Contributor Author

rricard commented Aug 4, 2016

@Slava thanks!

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

No branches or pull requests

3 participants