graphql-dotnet / graphql-dotnet/relay

Connection Builder seem to only support a single type

Open
#72 2 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
C#
Stars
74
Forks
28
PR merge metrics
No merged PRs in 30d

Description

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()
.Name("friends")
`

It would be translated internally to the following. The "Type" is built-in via [ModelConventionType](https://github.com/seekdavidlee/Eklee-Azure-Functions-GraphQl/blob/ada924b1cd18890d129a071f1371d6922e17496f/Eklee.Azure.Functions.GraphQl/ModelConventionType.cs).

`
Connection>()
.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>()
.Name("friends")
.Argument("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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.