Graphql 热巧克力-可以用泛型实现我自己的对象类型吗?

Graphql 热巧克力-可以用泛型实现我自己的对象类型吗?,graphql,hotchocolate,Graphql,Hotchocolate,我编写了以下对象类型类 public class ResponseType<T> : ObjectType<ResponseEntry<T>> { protected override void Configure(IObjectTypeDescriptor<ResponseEntry<T>> descriptor) { descriptor.Name("Response"); } } 似乎在声

我编写了以下对象类型类

public class ResponseType<T> : ObjectType<ResponseEntry<T>>
{
    protected override void Configure(IObjectTypeDescriptor<ResponseEntry<T>> descriptor)
    {
        descriptor.Name("Response");
    }
}

似乎在声明同一类类型的两个解析器时可能存在一些问题。是这样吗?如果是这样,我的选择是什么?

我可以通过基于
T
描述符.Name
设置为唯一值来解决问题

descriptor.Name($"Response_{typeof(T).GetHashCode()}");
然后我意识到我真正的问题是我在定义这个名字。如果不重写该名称,它会根据类型定义自动生成一个唯一的名称/键

System.Collections.Generic.KeyNotFoundException: 'The given key 'HotChocolate.Configuration.RegisteredType' was not present in the dictionary.'
descriptor.Name($"Response_{typeof(T).GetHashCode()}");