apollographql / apollo-ios

📱  A strongly-typed, caching GraphQL client for iOS, written in Swift.
https://www.apollographql.com/docs/ios/
MIT License
3.89k stars 728 forks source link

Allow ApolloCodegenLib for iOS targets as well #3276

Closed harish-suthar closed 1 year ago

harish-suthar commented 1 year ago

Use case

Every time I make some change in my query I have to manually run the ApolloCodegenLib' cli to update the .swift files for that query for the iOS app, if the ApolloCodegenLib supports iOS target we can easily write a run script to regenerate the code for updated queries.

Describe the solution you'd like

No response

AnthonyMDev commented 1 year ago

Hi @harish-suthar. I'm not clear on why you need the ApolloCodegenLib to target iOS. You should be able to create a run script that is a shell script that just calls into the CLI. You are running the run script on a mac, so it shouldn't need to be part of your iOS target directly.

We've had a lot of issues in the past with people accidentally linking the ApolloCodegenLib to their application code directly, which was causing them other issues. Disallowing this clears up some confusion there. The codegen itself is not intended to be run on iOS.

If you are able to give us more explanation of why you need to actually target iOS here, I'd be happy to discuss and reconsider.