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

Investigation: Allow codegen projects to modify generated filenames #3361

Closed
calvincestari opened this issue Mar 21, 2024 · 2 comments
Closed
Labels
codegen Issues related to or arising from code generation feature New addition or enhancement to existing solutions

Comments

@calvincestari
Copy link
Member

calvincestari commented Mar 21, 2024

Related to #3357.

  • This configuration must not be possible through the JSON configuration + CLI model.
  • This configuration must only be available to codegen that is executed through a custon codegen project, i.e.: calling codegen through code and not CLI.
  • The configuration should allow the codegen project to modify the generated filename before output.
  • The filename modification must not affect file content, i.e.: type names are not affected.
  • The filename modification must not affect file location, i.e.: file path remains the same.

This issue exists mostly to resolve the Xcode quirk of not being able to handle multiple files with the same name even though they are in different paths. Additionally it can help alleviate the existing problem of input type filenames clashing with other object type filenames.

We've been resistant to this type of feature in the past but the difference with this design is that Apollo iOS is not the one to be making the change based on an individual rule, such as prefixing the schema name to filenames, etc. Rather it is the client project that is being given the ability to modify the name.

@calvincestari calvincestari added feature New addition or enhancement to existing solutions codegen Issues related to or arising from code generation labels Mar 21, 2024
@calvincestari calvincestari added this to the Minor Releases (1.x) milestone Mar 21, 2024
@AnthonyMDev
Copy link
Contributor

The team has discussed this issue and we don't believe it's an appropriate fix for #3557. This would add a lot of complexity to the code generation engine and open up a lot of edge cases for us to deal with going forward.

The correct way to deal with this situation is to put each of your different schema's generated files into seperate targets that are linked against by your application targets.

@AnthonyMDev AnthonyMDev closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
Copy link
Contributor

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen Issues related to or arising from code generation feature New addition or enhancement to existing solutions
Projects
None yet
Development

No branches or pull requests

2 participants