Skip to content

Duplicate type registration #73

@maximkrouk

Description

@maximkrouk

Is there any behaviour that relies on String(describing: type) in

// Sources/Graphiti/Definition/AnyType.swift

final class AnyType : Hashable {
	// ...
    func hash(into hasher: inout Hasher) {
        hasher.combine(String(describing: type))
    }
    // ...
}

It won't allow you to use nested types for your models like
ModelA.Response
ModelB.Response
And you will get an error

Duplicate type registration for GraphQLType "Response" while trying to register type Response

Using String(describing: type) will provide "ModelA.Response" string, .components(separatedBy: ".").joined() can remove the dot if needed. Should I submit a PR to support this stuff?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions