contrib icon indicating copy to clipboard operation
contrib copied to clipboard

feat: allow aggregate ordering of through table edges

Open michaelcaulley opened this issue 1 year ago • 2 comments

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 avatar Oct 03 '23 02:10 michaelcaulley