-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sorting on collection attribute #4
Comments
Hi Greg, sorry for the delayed response - I've been on vacation. There is currently no support for sorting. The AQL query that is generated basically outputs a list of paths which is probably not particularly useful for sorting, other than perhaps the top level root vertices. I assume by the question you are looking to sort nested relationships so something like the following pseudo-GraphQL query
i.e. Sort Clients by name, sort each client's address by city. Is that right? |
yes, but top level sort would cover many use cases. For example, list of accounts ordered by account # or "friendly" name on the account, e.g. checking, savings ArangoDB-Community/arangodb-graphql-spring-boot-starter#1 , savings ArangoDB-Community/arangodb-graphql-spring-boot-starter#2 it would be ideal to have this with skip and limit, also, for pagination |
I've pushed a commit to my fork that should handle this. The way it should work is if you declare arguments on your query operation named,"limit", "skip", or "sort" it will handle them accordingly. Limit and Skip have the same meaning as the AQL documentation for Limit and Skip, and should be declared as Int type. Sort can be declared as a custom input type, as long as all its properties are scalar and can represent the String "ASC" or "DESC". An enum is a good choice here I think. Example Schema:
Example Query
If you think that works for your use case let me know and I will open a PR with the community repo, and update the docs. |
I've tested it locally and it works well. Nicely done. |
#4 - Adding support for Sort, Limit and Skip
Functionality included in v1.2 |
Is sorting provided for on edge and vertex collections?
The text was updated successfully, but these errors were encountered: