【发布时间】:2022-01-18 19:50:42
【问题描述】:
我有一个用 express 和 mongoose 制作的后端: 我所有的突变和查询都能正常工作,除了一个突变给我发送了一个无限的加载器
updateVehicleVerification: async (_, { id, updateVehicleVerification }) => {
const vehicleVeri = await VehicleVerification.findById(id);
if (!vehicleVeri) {
throw new Error(ErrorMessage + ' : Verification de Vehicule');
}
await VehicleVerification.findByIdAndUpdate(
id,
updateVehicleVerification
);
const veri = await VehicleVerification.findById(id);
return veri;
},
以及我在这里使用的查询:
导出常量 UPDATE_CONTROL_VEHICLE = gqlmutation updateVehicleVerification( $id: String! $updateVehicleVerification: VerificationVehicleInput ) { updateVehicleVerification( id: $id updateVehicleVerification: $updateVehicleVerification ) { honk { state image comment } mileage dateVerification stateVehicle { damaged good missing } } };
在此处输入代码
【问题讨论】:
标签: express react-hooks graphql apollo-client