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

Connection Builder seem to only support a single type #72

Open
seekdavidlee opened this issue Dec 6, 2020 · 2 comments
Open

Connection Builder seem to only support a single type #72

seekdavidlee opened this issue Dec 6, 2020 · 2 comments
Labels
question Further information is requested

Comments

@seekdavidlee
Copy link

Hi, I have a project that attempts to build a generic Type around a model which contains attributes necessary for building out the fields. This way, developers would only be focused on the model. For the example below where Droid is the model:

Connection<DroidType>() .Name("friends")

It would be translated internally to the following. The "Type" is built-in via ModelConventionType.

Connection<ModelConventionType<<Droid>>() .Name("friends")

I was able to use this technique in version 2.x to create multiple Connections for different paging requirements. Maybe one would be require a argument and the other does not.

Connection<ModelConventionType<<Droid>>() .Name("friends") .Argument<NameType>("name", "Name of friend")

It seems this no longer works in 3.x. I am getting the following error: the name 'ModelConventionConnection' is already registered to 'GraphQL.Types.Relay

As an experiment, if I create ModelConventionType2 but with the same type of Droid being reused in additional to a connection with ModelConventionType, it is also complaining of a similar error.

@rheid
Copy link

rheid commented Jan 31, 2021

The issue from @seekdavidlee It’s also really important for my project. I hope you can offer a solution in the framework.

@Shane32
Copy link
Member

Shane32 commented Apr 15, 2021

Could this be due to a failure of the automatic naming of types within GraphQL.NET to handle generic types?

@sungam3r sungam3r added the question Further information is requested label May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants