You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 3, 2021. It is now read-only.
Ordering relations is oftentimes important.
Would it be possible to add an optional orderBy and orderByDesc to the @relation directive?
This should be able to order on fields that are not part of a selectionSet.
The text was updated successfully, but these errors were encountered:
As part of the schema augmentation processorderBy arguments are added to all relationship fields, including an enum for ordering in ascending/descending order by any of the scalar fields on the related type. However as per #47 there is a bug that prevents ordering in nested selections. Currently ordering only works at the top level operation, despite these orderBy arguments being added to the schema.
I'm closing this issue as a duplicate of #47 and let's track the issue there.
@johnymontana I actually believe this needs additional discussion. An orderBy in the @relation directive would be useful for default ordering. As far as I'm aware, the only other way to create a default order currently would be to use a custom cypher directive.
I'd argue that providing a default order belongs in the graphql server layer rather than requiring clients to specify an order.
For example, in my use case, I have a workout app. Each workout has a list of exercises, and each exercise has a list of instructions. It is always the case that exercises and instructions would be in some default order. Therefore, it seems cumbersome to require the client to specify an order.
# for freeto subscribe to this conversation on GitHub.
Already have an account?
#.
Ordering relations is oftentimes important.
Would it be possible to add an optional
orderBy
andorderByDesc
to the@relation
directive?This should be able to order on fields that are not part of a selectionSet.
The text was updated successfully, but these errors were encountered: