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

1.18.0 - Missing argument for parameter 'implementingObjects' #3515

Closed
rudyfremont opened this issue Feb 19, 2025 · 11 comments
Closed

1.18.0 - Missing argument for parameter 'implementingObjects' #3515

rudyfremont opened this issue Feb 19, 2025 · 11 comments
Labels
bug Generally incorrect behavior needs investigation

Comments

@rudyfremont
Copy link

Summary

I have compilation error with the latest SDK version (1.18.0) for Interface - No issue with the 1.17.0 version

Image

Version

1.18.0

Steps to reproduce the behavior

just try to compile generated files

Logs

Anything else?

No response

@rudyfremont rudyfremont added bug Generally incorrect behavior needs investigation labels Feb 19, 2025
@BobaFetters
Copy link
Member

Have you regenerated your code yet? There are some minor changes in the structure of some of the generated code to support the "Reduce generated schema types" feature. This new property on Interface being on of them.

@rudyfremont
Copy link
Author

Oops, I thought I'd done it but it looks like my CLI hasn't been updated correctly
Now the generated files are modified and the code compiles!
Sorry :)

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.

@cameroncooke
Copy link

Isn't this considered a breaking change and should be versioned accordingly? I've run into the same issue for a minor point release update for Apollo.

@BobaFetters
Copy link
Member

@cameroncooke Changes in the generated code wouldn't be considered breaking since they don't require manual code changes by the user, and code generation should always be be run when updating versions so that the generated code is created from a version of the codegen library matching the apollo-ios version.

@cameroncooke
Copy link

That makes a ton of assumptions. We're using SPM packages and can't run code gen like you would a build phase in an Xcode Project setup. SPM updates are automatic based on semantic versioning.

@BobaFetters
Copy link
Member

BobaFetters commented Feb 27, 2025

There are definitely some things that would be nice to have in SPM, like being able to run a script etc when a package updates, unfortunately that's not available, however other users have built SPM plugins to run codegen like running a build phase in Xcode, there is some discussion around that here. We do have open issue for building more official support for this but the features and work necessary to do that aren't currently high on our priority list. Depending on your workflow a build plugin may or may not be ideal, there are different ways this can be handled though, and can also depend on if you are using the CLI tool for codegen or scripting the codegen in Swift.

The root of things though like I mentioned is the generated code need to match the version of apollo-ios in use, it is possible that mismatched versions could function correctly, but its highly dependent on changes that may happen in either library that could be invisible to the user but still affect overall functionality. This is less an assumption and more a requirement of the library, and if you run a version of the codegen CLI tool that doesnt match your apollo-ios version you will see an error that you are using a mismatched version.

@cameroncooke
Copy link

cameroncooke commented Feb 27, 2025 via email

@cameroncooke
Copy link

cameroncooke commented Mar 4, 2025

Out of interest can I draw attention to this:

This feature request makes sense if you're upgrading directly from the legacy (0.x) versions where it was recommended to have a build step in your project that would run code generation as part of each build. We no longer make that recommendation in 1.0; it's not necessary for code generation to be run with each build because the schema/operation files do not typically change between each build. It's worth noting though that you can still achieve the same build step by using the new CLI tool.

#3267 (comment)

Are you no saying this no longer holds true, it's kind of confusing tbh.

@calvincestari
Copy link
Member

Are you no saying this no longer holds true, it's kind of confusing tbh.

tl;dr - there is nuance to this.

I wrote that comment and I believe it's still valid. It is still our recommendation that a code generation build step is typically not needed and would result in unnecessary build time. Each project is different though so chose the path that best suits your needs.

As mentioned above we do not view this specific issue as a breaking change. I agree it is confusing though and we could have done a better job of highlighting the need to rerun code generation in this release. We'll consider that going forward.

@cameroncooke
Copy link

cameroncooke commented Mar 4, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior needs investigation
Projects
None yet
Development

No branches or pull requests

4 participants