Closed grebleem closed 4 months ago
Hi @grebleem, thanks for creating the issue. From that error it looks like there is an interface named "Interface". So I pulled the sorare GraphQL schema to confirm and yes that does indeed seem to be the cause of the error.
interface Interface {
createdAt: ISO8601DateTime!
id: ID!
reactions: [ActivityReactionType!]!
}
I would have thought we had this name covered with our reserved names logic but it looks like this one might have slipped through. We'll get it resolved asap and hopefully included in the next release.
Thank you for the feedback. As a temporary fix I renamed Interface
in the generated files to InterfaceAlias
, so the code builds again.
I just realized this can easily be fixed by changing the generated code to namespace ApolloAPI.Interface
.
It should be generated as:
public extension Interfaces {
static let Interface = ApolloAPI.Interface(name: "Interface")
}
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.
Version 1.11.0 is being released shortly. It will include the fix for this issue.
I just realized this can easily be fixed by changing the generated code to namespace
ApolloAPI.Interface
.It should be generated as:
public extension Interfaces { static let Interface = ApolloAPI.Interface(name: "Interface") }
Really useful tip! Thanks!!!
Summary
After updating the schema from Sorare: https://api.sorare.com/federation/graphql and running the `apollo-ios-cli generate', without any error, Xcode generates the flowing build errors:
Perhaps it is an error in the schema from Sorare, but I am unable to resolve this issue, perhaps it is a bug in Apollo-iOS.
Any ideas?
Version
1.10.0
Steps to reproduce the behavior
Cleaning the build and delete the derived data folder did not resolve the issue.
Logs
Anything else?
No response