Heating and Electricity Mutations fail
Closed this issue · 4 comments
codingfabi commented
When trying to create a heating or emission entry, the backend call fails with the following error:
[
{
"message": "Cannot query field \"ok\" on type \"CreateHeating\".",
"locations": [
{
"line": 5,
"column": 5
}
]
}
]
Request Payload:
{
"operationName": "createHeating",
"variables": {
"timestamp": "2020-03-01",
"consumption": 5220,
"fuelType": "Hear pump (air)",
"building": "205",
"groupShare": 12,
"unit": "l"
},
"query": "mutation createHeating($timestamp: Date!, $consumption: Float!, $unit: String!, $fuelType: String!, $building: String!, $groupShare: Float!) {\n createHeating(\n input: {timestamp: $timestamp, consumption: $consumption, unit: $unit, fuelType: $fuelType, building: $building, groupShare: $groupShare}\n ) {\n ok\n __typename\n }\n}\n"
}
sami1riaz commented
We forgot to update the mutation on the frontend after changing all the ok to success in the backend mutations for the data forms (this issue exists for all dataforms)
codingfabi commented
@sami1riaz does this make it a pure frontend issue then?
sami1riaz commented
Yes, I have fixed the issue in my branch. Just resolving a few more things regarding the dataforms before submitting a PR
sami1riaz commented
Created a PR for this fix. Will deal with Form issues separately