-
Notifications
You must be signed in to change notification settings - Fork 730
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
Codegen: Add Identifiable
conformance
#710
Comments
Ideally it should auto implement |
@rodrigoelp Hashable and Equatable conformance will be added by default in updated codegen - please see the RFC in #939 for details. |
Ah, bad @designatednerd, I did read that issue (only the part of |
@designatednerd is there something missing in this query or a doc for GraphQLID I can take a look at? This project is running on Swift 5.6.1 but not seeing query getLiveStreams($status: LiveStreamStatus) {
liveStreams(status: $status) {
id
channel {
id
name
}
}
} |
Hi Daisy, I no longer work at Apollo so information on timeline is best gotten from @AnthonyMDev and @calvincestari, but this was not implemented in Original Crispy Flavor™ codegen, it may be coming in updated codegen but I remember running into some issues around it. Guys, any thoughts? |
This is not being implemented in the 1.0 release with the new Codegen. There are a lot of good reasons why this is not being included. Primarily, GraphQL objects should be stored using the GraphQL |
Is there a reason to not implement Identifiable as suggested in this ticket? It would make iterating over collections in SwiftUI a bit less boilerplatey: CurrentForEach(users, id: \.self.id) { user in
NavigationLink(destination: UserDetails(user: user)) {
Text(user.name)
}
.tag(user.id)
} With IdentifiableForEach(users) { user in
NavigationLink(destination: UserDetails(user: user)) {
Text(user.name)
}
} |
Great idea from the thread seeking Swift codegen suggestions - anything that has a GraphQLID should conform to
Identifiable
.Note:
Identifiable
is part of the Swift 5.1 release, so it will need to wait until that gets finalized. That's likely well before the updated codegen gets finalized, though.The text was updated successfully, but these errors were encountered: