有没有办法默认忽略 GraphQL 类型上的所有字段,只添加想要的字段?
Hot Chocolate 从 C# 类型中自动推断出 GraphQL 类型成员。
这意味着以下代码...
public class Foo
{
public string Bar { get; set; }
public string? Baz { get; set; }
}
public class FooType : ObjectType<Foo>
{
}
将产生以下 GraphQL 类型:
type Foo {
bar: String!
baz: String
}
在我的用例中,我想更改此行为并明确定义我的 C# 类型的哪个类型成员在 GraphQL 类型中使用。