Skip to content

[Bug]: GraphQL Aliased Field Queries Cause Duplicate Dictionary Key Error for Same Entity #3229

@JerryNixon

Description

@JerryNixon

Discussed in #2785

Originally posted by ascii1010 July 24, 2025

brochure: books(
  filter: { type: { eq: "brochure" } }
) {
  items {
    id
    description
  }
}

magazine: books(
  filter: { type: { eq: "magazine" } }
) {
  items {
    id
    description
  }
}

The above generates error:

An item with the same key has already been added. Key: books

Theory

The issue is not GraphQL itself. It is the resolver implementation using the entity name as the dictionary key instead of the alias or a unique field identifier. Two selections of books are valid GraphQL, but the server code is deduplicating by entity name and therefore treating them as a duplicate dictionary key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    criCustomer Reported issuegraphql

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions