graphprotocol / graphprotocol/graph-node

[Bug] Disallow sorting by child fields that are arrays

Open
#5,207 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

Bug report

In a subgraph schema like

type Parent {
  id: ID!
  children: [Child!]!
}

we allow a query like parents(orderBy: children__id) { .. } but that ordering doesn't make much sense. When a parent has multiple children, it's not clear which child's id we will use for the ordering. We should simply not support that.

Some information to help us out
  • Tick this box if this bug is caused by a regression found in the latest release.
  • Tick this box if this bug is specific to the hosted service.
  • I have searched the issue tracker to make sure this issue is not a duplicate.
OS information

None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named in the issue. Start by tracing how GraphQL orderBy fields are validated for nested relations, then reproduce the Parent/children schema case; done means ordering by an array-valued child field is rejected while supported scalar relations remain valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.