你能解释一下为什么变异的输入参数为对象时应该是 输入类型吗?我认为更简单的方法是只重用 类型而不提供 id。
例如:
type Sample {
id: String
name: String
}
input SampleInput {
name: String
}
type RootMutation {
addSample(sample: Sample): Sample # <-- instead of it should be
addSample(sample: SampleInput): Sample
}
对于小对象来说还可以,但是当模式中有大量具有10 + 属性的对象时,这将成为一种负担。