Skip to content

Aliases of one relation without arguments lose a nested selection (DTOMissing) #405

Description

@gazorby

Description

Two aliases of the same relation without arguments are merged into one query node. When their nested selections differ, only one of them gets its fields or collections loaded, and the other alias resolves to DTOMissing.

Reproduction

Against the integration test schema (SQLite or PostgreSQL):

{
  colorsSweet {
    id
    a: fruits { id farms(limit: 1) { id name } }
    b: fruits { id farms(limit: 2) { id } }
  }
}
String cannot represent value: <class DTOMissing>

a and b both select fruits with no arguments, so they collapse into one node. Their farms children differ (limit: 1 with name, limit: 2 without), and only one of the two farms selections loads name.

Other symptoms of the same cause

Fuzzing alias-heavy queries turned up the same family of errors:

  • String cannot represent value: <class DTOMissing>
  • Expected value of type 'ProductType' but got: <class DTOMissing>
  • Expected Iterable, but did not find one for field 'FruitType.farms'

All of them reproduce identically on main (60857f2), so this is not a recent regression.

Expected

Each alias returns its own nested selection, as if the two aliases had been queried separately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions