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

Same field with alias in a fragment is getting ignored in collectFields #1299

Closed
abhimanyusinghgaur opened this issue Aug 20, 2020 · 0 comments · Fixed by dgraph-io/gqlgen#3 or #1341
Closed

Comments

@abhimanyusinghgaur
Copy link
Contributor

What happened?

For this query:

query {
  queryCharacter {
    ... on Human {
      name
      n: name
    }
  }
}

The selection set returned by collectFields contains only the field name. It doesn't contain the aliased field n: name.

What did you expect?

I expect the selection set returned by collectFields to contain both name and the aliased field n: name.

Minimal graphql.schema and models to reproduce

interface Character {
        id: ID!
        name: String!
}

type Human implements Character {
        totalCredits: Float
}

versions

  • gqlgen version? v0.12.2
  • go version? go1.14 linux/amd64
  • dep or go modules? go modules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant