在这个例子中如何添加用户?我尝试以各种方式使用突变,但不起作用。
type User {
masterId: Int
name: String
surname: String
address: Address
}
type Address {
street: String
flat: Int
city: String
country: String
}
我尝试这样的事情:
type Mutation {
user(
masterId: Int
name: String
surname: String
address: Address
): User
}
接下来
mutation {
user(
masterId: 4,
name: "Kevin",
surname: "Key",
address: {
street: "Clark Street",
flat: 19,
city: "Brentwood",
country: "United Kingdom"
}
)
}
我尝试了不同的版本,但我真的找不到解决方案