You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When fragments have a recursive structure, the generated type alias can become self-referencing and the module can't compile.
/Users/jmccance/Development/apollographql-typealias-references-itself/MySchema/Sources/Operations/Queries/GetLinksQuery.graphql.swift:123:28: error: type alias 'Link' references itself
publictypealiasLink=Link.To.Link
Version
1.9.0
Steps to reproduce the behavior
I've confirmed this behavior on 1.8.0 and 1.9.0. It seems to occur when using interfaces and multiple fragments on that interface.
$ ./apollo-ios-cli generate && (cd MySchema && swift build)
Building for debugging...
error: emit-module command failed with exit code 1 (use -v to see invocation)
/Users/jmccance/Development/apollographql-typealias-references-itself/MySchema/Sources/Operations/Queries/GetLinksQuery.graphql.swift:123:28: error: type alias 'Link' references itself
public typealias Link = Link.To.Link
^
/Users/jmccance/Development/apollographql-typealias-references-itself/MySchema/Sources/Operations/Queries/GetLinksQuery.graphql.swift:123:43: note: while resolving type 'Link.To.Link'
public typealias Link = Link.To.Link
^
/Users/jmccance/Development/apollographql-typealias-references-itself/MySchema/Sources/Operations/Queries/GetLinksQuery.graphql.swift:123:28: error: type alias 'Link' references itself
public typealias Link = Link.To.Link
^
/Users/jmccance/Development/apollographql-typealias-references-itself/MySchema/Sources/Operations/Queries/GetLinksQuery.graphql.swift:123:43: note: while resolving type 'Link.To.Link'
public typealias Link = Link.To.Link
^
error: fatalError
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Hi Dominic. Thanks for letting us know that this is also blocking you. I'm working on a complex, high priority feature right now, so I'm not going to be able to get to this just yet, but I've marked this issue as high priority also and hope to dig into in as soon as I'm finished with what I'm working on. Can't give too great of an ETA until I get to research how to solve this.
Sorry Anthony, Joel and I work together at M1. I was just trying to follow up on the status thank you for the update. And thank you for keeping an eye on this
Summary
When fragments have a recursive structure, the generated type alias can become self-referencing and the module can't compile.
Version
1.9.0
Steps to reproduce the behavior
I've confirmed this behavior on 1.8.0 and 1.9.0. It seems to occur when using interfaces and multiple fragments on that interface.
schema.graphqls
GetLinks.gql
These two together generate this offending block:
For a complete reproduction of the bug, take a look at https://github.com/jmccance/apollographql-typealias-references-itself.
Logs
Anything else?
No response
The text was updated successfully, but these errors were encountered: