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

StrawberryShake fragments should not be merged #3516

Closed
glucaci opened this issue Apr 16, 2021 · 0 comments · Fixed by #3542
Closed

StrawberryShake fragments should not be merged #3516

glucaci opened this issue Apr 16, 2021 · 0 comments · Fixed by #3542

Comments

@glucaci
Copy link
Contributor

glucaci commented Apr 16, 2021

Given the following query

query person {
  person {
    ...PersonName
  }
}

fragment PersonName on Person {
  ...PersonFirstName
  name {
    lastName
  }
}

fragment PersonFirstName on Person {
  name {
    firstName
  }
}

The generated code is merging name { lastName } from PersonName fragment, into PersonFirstName fragment.

As workaround on the field can be set an alias

fragment PersonName on Person {
  ...PersonFirstName
  lastName: name {
    lastName
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants