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

Namespace collision when using Schema for schemaName #2664

Closed
StarLard opened this issue Nov 15, 2022 · 2 comments · Fixed by #2755
Closed

Namespace collision when using Schema for schemaName #2664

StarLard opened this issue Nov 15, 2022 · 2 comments · Fixed by #2755
Assignees
Labels
bug Generally incorrect behavior codegen Issues related to or arising from code generation planned-next Slated to be included in the next release

Comments

@StarLard
Copy link

Bug report

When you pass schema for schemaName to generate types using the swiftPackageManager , the generated code will not compile because the generated module collides with an Apollo Schema type. It would be great if we document invalid schemaName values somewhere or use explicit namespacing in Apollo to avoid this.

Versions

Please fill in the versions you're currently using:

  • apollo-ios SDK version: 1.0.3
  • Xcode version: 14.0.1
  • Swift version: 5.7
  • Package manager: SPM

Steps to reproduce

  1. Generate code using the swiftPackageManager module type using schema for schemaName
  2. Add generated Swift Package to target
  3. Attempt to build project
  4. Observe error
@StarLard
Copy link
Author

For context I ran into this issue because my schema is named schema.graphqls and I was attempting to pass the name of my schema file; I think #2642 would also help avoid this issue.

@calvincestari
Copy link
Member

Thanks for reporting this @StarLard. We'll take a look into this and see what we can do about it.

@calvincestari calvincestari added this to the Release 1.0.6 milestone Nov 22, 2022
@calvincestari calvincestari removed this from the Release 1.0.6 milestone Nov 29, 2022
@calvincestari calvincestari added codegen Issues related to or arising from code generation bug Generally incorrect behavior and removed needs investigation labels Dec 2, 2022
@calvincestari calvincestari added this to the Release 1.0.6 milestone Dec 2, 2022
@calvincestari calvincestari self-assigned this Jan 5, 2023
@calvincestari calvincestari added the planned-next Slated to be included in the next release label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior codegen Issues related to or arising from code generation planned-next Slated to be included in the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants