Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple references to the same field within the same object are not merged #572

Open
nbudin opened this issue Oct 11, 2024 · 0 comments
Open

Comments

@nbudin
Copy link

nbudin commented Oct 11, 2024

Describe the bug

Referencing the same field multiple times within the same object should merge all the referenced subfields inside that field together, but currently this doesn't happen - instead, the last reference to a field overwrites all previous ones.

To Reproduce
This query reproduces the issue:

query fieldMerging($id: ID!) {
  person(id: $id) {
    id
    firstName
    lastName

    address {
      country
    }

    address {
      city
      state
    }
  }
}

Expected behavior
The resulting OpenAPI schema should include country, city, and state in the address property of person, but it only includes city and state.

Desktop (please complete the following information):

  • OS: macOS 14.7
  • Node v20.18.0

Additional context
I've also tested this using fragment spreads, and they have the same incorrect behavior.

@nbudin nbudin mentioned this issue Oct 11, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant