我在graphql查询中遇到了以上错误,我正在顺便起诉apollo-react,并使用Query组件呈现数据
这是我的代码
const GET_VEHICLE_CHECKS = gql`
query getVehicleChecks($uuid: String!) {
tripDetails(uuid: $uuid){
departmentAssigned{
vehicleChecks{
conditions{
id
name
standard
valueType
spinnerItems
}
}
}
}
`;
这就是我的实际查询结果
{
tripDetails(uuid: "c0e7233093b14afa96f39e2b70c047d8"){
departmentAssigned{
vehicleChecks{
conditions{
id
name
standard
valueType
spinnerItems
}
}
}
vehicleConditions{
id
condition{
id
standard
}
value
}
}
}
我尝试更改变量名称,但这没用
答案 0 :(得分:1)
查询末尾您缺少右括号}
。
const GET_VEHICLE_CHECKS = gql`
query getVehicleChecks($uuid: String!) {
tripDetails(uuid: $uuid){
departmentAssigned{
vehicleChecks{
conditions{
id
name
standard
valueType
spinnerItems
}
}
}
}
} <- THIS
`;