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

test: Duplicate fields in queries with fragments #6623

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

ajeetdsouza
Copy link
Contributor

@ajeetdsouza ajeetdsouza commented Oct 1, 2020

GRAPHQL-654 has been fixed in #6596, this PR simply adds a test for it. The problem occurring was that using multiple fragments containing the same field would cause that field to appear multiple times in the output. Example:

Query:

fragment TaskID on Task {
  remoteId: id
  remoteType: __typename
}

fragment Task on Task {
  title
  remoteId: id
  completed
}

query {
  queryTask {
    ...TaskID
    ...Task
  }
}

Schema:

type Task {
  id: ID!
  title: String!
  completed: Boolean!
}

The resultant JSON listed remoteId twice, which was a bug.


This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Oct 1, 2020
@ajeetdsouza ajeetdsouza merged commit 085a002 into master Oct 5, 2020
@ajeetdsouza ajeetdsouza deleted the ajeetdsouza/duplicate-fields branch June 2, 2021 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph.
Development

Successfully merging this pull request may close these issues.

2 participants