Can't sort the query result set by a valid worker_DESC property defined in the schema
Open
Nobody has claimed this yet.
med-prio
qn-hydra-board
to-triage
- Dominant language
- TypeScript
- Stars
- 50
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
Steps to reproduce
Console: https://graphql-console.subsquid.io/?graphql_api=https://query.joystream.org/graphql
Execute query
query Payouts {
rewardPaidEvents(orderBy: worker_DESC) {
id
}
}
Actual Result:
{
"errors": [
{
"message": "column rewardpaidevent.undefined does not exist",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"rewardPaidEvents"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"message": "column rewardpaidevent.undefined does not exist",
"length": 124,
"name": "QueryFailedError",
"severity": "ERROR",
"code": "42703",
"position": "152",
"file": "parse_relation.c",
"line": "3349",
"routine": "errorMissingColumn",
"query": "SELECT \"rewardpaidevent\".\"id\" AS \"rewardpaidevent_id\" FROM \"reward_paid_event\" \"rewardpaidevent\" WHERE \"rewardpaidevent\".\"deleted_at\" IS NULL ORDER BY \"rewardpaidevent\".\"undefined\" DESC LIMIT 50",
"parameters": []
}
}
}
],
"data": null
}
Expected result
The query is valid, so I expect some data in response.
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 by reproducing the rewardPaidEvents query in the linked GraphQL console and trace the orderBy handling for worker_DESC. Inspect the generated SQL shown in the error, especially why the field becomes undefined. Done means the valid query returns data without an invalid-column error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, postgresql, typescript
- Domain
- api, backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100