apollo-tooling icon indicating copy to clipboard operation
apollo-tooling copied to clipboard

Swift codegen: Include namespace in fragment struct type names

Open RobinDaugherty opened this issue 4 years ago • 1 comments
trafficstars

Fixes #2396

By placing the namespace in front of any fragment struct name, we can ensure that the fragment type will be unambiguous. If the fragment is used in a query that has a node (and therefore type name) with the same name as the fragment's type name, Swift doesn't get confused about which type is being referred to.

However, the namespace is not included in the name when declaring the fragment's struct, so there's a new method that is used to get the name for its declaration.

TODO:

  • [x] Update CHANGELOG.md* with your change (include reference to issue & this PR)
  • [ ] Make sure all of the significant new logic is covered by tests
  • [ ] Rebase your changes on master so that they can be merged easily
  • [ ] Make sure all tests and linter rules pass

*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.

RobinDaugherty avatar Jul 28 '21 21:07 RobinDaugherty

@RobinDaugherty: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

apollo-cla avatar Jul 28 '21 21:07 apollo-cla