-
Notifications
You must be signed in to change notification settings - Fork 739
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
MutableSelectionSet child objects missing selections #3437
Comments
No your code looks correct, and this should be supported. It seems like it's a bug that the We'll need to see if we can reproduce this. |
@pixelmatrix can you please share the generated code for Attached is my attempted reproduction case but I get a populated |
Here's what I have: |
@pixelmatrix I think I've managed to replicate the missing Have you executed codegen with a version 1.15.0, or greater, to see if it resolves the issue? |
We're using Apollo 1.17.0 currently, which I assumed includes codegen too, but maybe it's not getting updated automatically in my setup. I'll dig into this more and report back. |
If you're executing codegen using the CLI then it is included with apollo-ios as we distribute a codegen binary with each version. However, if you're generating through code and depending on the apollo-ios-codegen package directly then you will need to be updating that dependency too. |
It's done via the CLI, but for some reason my |
You can check the version of the binary with the command |
Can you share your fragment definitions for this please. Are they defined exactly like you have in the description or is it multiple fragments within each other? This is what gave me a shape similar to the MutableIssueFields.graphql.swift file you shared last week: fragment MutableIssueFields on Issue @apollo_client_ios_localCacheMutation {
...IssueDetailFields
}
fragment IssueDetailFields on Issue {
id
state {
...WorkflowStateFields
}
}
fragment WorkflowStateFields on WorkflowState {
id
name
}
|
Yeah, it's actually composed of many fragments. The shape is essentially what you described above, but it goes through one more fragment (
|
Ok, that'll help. I'll have another go at this in the morning. |
Summary
I have a mutable fragment that has relationships to other objects, like this:
Codegen ends up creating
MutableIssueFields
andMutableIssueFields.State
. The parent objectMutableIssueFields
has a__selections
property as you'd expect, butMutableIssueFields.State
does not.I'm trying to change the value from one "state" to another using a local cache mutation. However, when I try to load the
MutableIssueFields.State
object from the cache, I get an empty object because the__selections
field is empty.I'm calling it like this:
Is this something that should be supported? If not, is there a preferred way to update this relationship to another existing object in the cache?
Version
1.14.1
Steps to reproduce the behavior
readObject
Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: