Skip to content
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

Duplicate type registration #73

Open
maximkrouk opened this issue Feb 10, 2022 · 0 comments
Open

Duplicate type registration #73

maximkrouk opened this issue Feb 10, 2022 · 0 comments
Labels

Comments

@maximkrouk
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants