Skip to content

Renaming ConnectionTypes isn't working #106

@cshadek

Description

@cshadek

Renaming connection types, doesn't seem to fully work.

Type(ChatObject.self, as: "Chat") {
    Field("messages", at: ChatObject.messages, as: Connection<MessageObject>.self) {
                    Argument("first", at: \.first)
                    Argument("after", at: \.after)
                    Argument("last", at: \.last)
                    Argument("before", at: \.before)
    }
}

Type(MessageObject.self, as: "Message") {
    Field("id", at: \.id)
    Field("text", at: \.text)
}

ConnectionType(MessageObject.self, as: "Message")

I get the following error:
Fatal error: 'try!' expression unexpectedly raised an error: Type "MessageObjectConnection" was referenced but not defined.

When I don't rename the ConnectionType, then the schema builds, but I end up with MessageObjectConnection instead of MessageConnection.

If I don't include the Chat type, then the schema builds with the correct MessageConnection name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions