我有这个奇怪的问题。也许我错过了什么
我有两张桌子,车辆和购买
当我尝试通过以下方式查询车辆时
query {
vehicles{
id
}
}
正常返回数据
{
"data": {
"vehicles": [
{
"id": 29
}
]
}
}
但是有了这个查询
query {
purchase{
id
}
}
我收到此错误
{
"error": {
"errors": [
{
"message": "Field \"purchase\" argument \"where\" of type \"purchaseWhereUniqueInput!\" is required, but it was not provided.",
"locations": [
{
"line": 2,
"column": 3
}
],
这是我的代码:-
export const PaymentQuery =extendType({
type :"Query",
definition(t) {
t.crud.purchase({filtering : true , pagination : true , ordering : true , })
}
})
export const VehicleQuery = extendType({
type : "Query",
definition(t) {
t.crud.vehicles({filtering : true , pagination : true , ordering : true , });
}
})