graphprotocol / graphprotocol/graph-node
Cannot Sort queries by enum
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Description
Do you want to request a feature or report a bug?
Feature (maybe bug)
What is the current behavior?
When you make a query and try to sort on an enum you get an error.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
What is the expected behavior?
Ideally we would want to be able to sort using an enum. I believe the issue is that enum Types create a custom type that can't be sorted in AssemblyScript, but they are almost always strings. I guess I would imagine it should be stored as a string (maybe) and then it would be able to be sorted on like that.
Against my point, if you made an enum numbers it wouldn't be totally accurate.
Moral of the story, it would be nice to sort on enums. Example query
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked GraphQL query and reproduce the failure when ordering positions by the enum field side. No files or tests are named in the issue, so trace the query's enum orderBy handling; done means enum fields can be used for sorting with defined behavior for string and numeric values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, rust
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100