C# GraphQL的内部自省查询;ofType";接口的possibleTypes内的属性始终为null
我创建了以下类型的GraphQL接口:C# GraphQL的内部自省查询;ofType";接口的possibleTypes内的属性始终为null,c#,.net,graphql,C#,.net,Graphql,我创建了以下类型的GraphQL接口: public class TestInterfaceResolver : InterfaceGraphType<Test> { public TestInterfaceResolver() { Name = "Test"; Field<NonNullGraphType<StringGraphType>>()
public class TestInterfaceResolver : InterfaceGraphType<Test>
{
public TestInterfaceResolver()
{
Name = "Test";
Field<NonNullGraphType<StringGraphType>>()
.Name("item1");
Field<NonNullGraphType<StringGraphType>>()
.Name("item2");
}
}
以下是输出:
...
{
"kind": "INTERFACE",
"name": "Test",
"possibleTypes": [
{
"name": "MyClass",
"kind": "OBJECT",
"ofType": null
},
.... (my other classes)
]
}
...
在这里,类型字段的响应总是返回null。它应该返回具有kind属性的对象
有人能帮我做这个吗?不,不应该<代码>MyClass已在其他位置定义。。。事实并非如此,否则GraphQL已经给出了一个例外,如果解析器/输入类型定义为两个完全不同的东西。。。IDK c#但根据它应该是
InterfaceGraphType
,而不是InterfaceGraphType
对不起,myBad它已经在测试中了。我更新了问题
{
__schema {
types {
kind
name
possibleTypes {
name
kind
ofType {
kind
}
}
}
}
}
...
{
"kind": "INTERFACE",
"name": "Test",
"possibleTypes": [
{
"name": "MyClass",
"kind": "OBJECT",
"ofType": null
},
.... (my other classes)
]
}
...