apollographql / apollo-ios

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

[Xcode 16] Mutating property of a fragment causes compile time error #3398

Closed martin-muller closed 2 months ago

martin-muller commented 3 months ago

Summary

Mutating property of a fragment annotated with @apollo_client_ios_localCacheMutation directive causes the following compile time error in Xcode 16 b1 with Swift 6:

Setter for 'fragments' is unavailable: mutate properties of the fragment instead.

I had a look around online but don't see mentions of changes to behaviour of modify anywhere, do you know if this is issue in Swift or change will have to be done in apollo?

Version

1.12.2

Steps to reproduce the behavior

this issue is reproducible in tests for this project:

Logs

No response

Anything else?

No response

AnthonyMDev commented 3 months ago

Thanks for making us aware of this. We'll look into this one ASAP. I haven't seen anything in the Swift 6 language that obviously would cause this, but there must be something that changed here.

github-actions[bot] commented 2 months ago

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.

PSinha1202 commented 1 month ago

I am pointing to latest tag 1.15.0 and still see the issue. I expected this to be fixed and ready in latest tags, am I missing something?

AnthonyMDev commented 1 month ago

Have you re-run the code generation with the latest version? This fix changes the generated models to remove the warning.