8000 feat: allow aggregate ordering of through table edges by michaelcaulley · Pull Request #547 · ent/contrib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: allow aggregate ordering of through table edges #547

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michaelcaulley
Copy link
Contributor
@michaelcaulley michaelcaulley commented Oct 3, 2023

Summary

  • Add support for using entgql.OrderField() aggregates for edges that use a Through table.
  • The OrderField string must be prefixed with the string value of the edge. For example:
	edge.To("friends", User.Type).
			Through("friendships", Friendship.Type).
			Annotations(entgql.RelayConnection()),

would require the OrderField string to start with FRIENDS_

For the count aggregation the full string would be FRIENDS_COUNT.

  • The changes skip the through table OrderBy and only use the original edge OrderBy.

@michaelcaulley michaelcaulley marked this pull request as draft October 3, 2023 02:45
@michaelcaulley michaelcaulley force-pushed the order-by-edge-with-through-table branch from 142b18d to 92f352e Compare October 3, 2023 12:57
@giautm giautm self-assigned this Oct 3, 2023
@michaelcaulley michaelcaulley force-pushed the order-by-edge-with-through-table branch from 92f352e to 7517af4 Compare October 3, 2023 16:14
@michaelcaulley michaelcaulley marked this pull request as ready for review October 3, 2023 16:14
@michaelcaulley
Copy link
Contributor Author

Thanks for taking a look at this @giautm. I generated the code for the projects that I missed.

@michaelcaulley
Copy link
Contributor Author

@giautm anything I can help with to get this merged?

Copy link
Collaborator
@giautm giautm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for your contribution.

@michaelcaulley michaelcaulley force-pushed the order-by-edge-with-through-table branch from 7517af4 to b056f45 Compare October 20, 2023 12:45
@michaelcaulley michaelcaulley force-pushed the order-by-edge-with-through-table branch from b056f45 to 402de01 Compare November 22, 2023 23:14
@giautm giautm requested a review from a8m December 31, 2023 18:34
@michaelcaulley michaelcaulley force-pushed the order-by-edge-with-through-table branch from 402de01 to 4feb049 Compare February 12, 2024 17:31
@michaelcaulley michaelcaulley force-pushed the order-by-edge-with-through-table branch from 4feb049 to e9ec4bb Compare September 10, 2024 01:44
@michaelcaulley michaelcaulley force-pushed the order-by-edge-with-through-table branch 2 times, most recently from 4aabfb9 to 4cefd73 Compare April 9, 2025 01:04
@michaelcaulley michaelcaulley force-pushed the order-by-edge-with-through-table branch from 4cefd73 to c972521 Compare April 9, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0