Hi there!
I’ve been using GraphQL API for 3 months. I love the monday.com!
I probably found a bug in mutation (create_item and change_column_value).
When I use mutation query, sometimes some items will be null.
Reference: Screenshot - a9cc1089a290e639bee15d6e13d01b71 - Gyazo
My Node.js code is below,
const mondayItemPost = async () => {
const items = () => {
let obj = {}
for (let mo of mondayAry) {
obj[mo.id] = mo.value
}
//in the end, set initial status
obj['status'] = {index: 1}
return obj
}
const data = {
query: `mutation ($boardId: Int!, $groupId: String!, $itemName: String!, $columnValues: JSON!) {
create_item (
board_id: $boardId,
group_id: $groupId,
item_name: $itemName,
column_values: $columnValues
) {
id
}
}`,
variables: {
boardId: {**writing a board id**},
groupId: '_____',
itemName: {**writing an item name**},
columnValues: JSON.stringify(items())
}
}
return await axios.post(mondayUrl, data, {headers: mondayHeaders}).then(mondayRes => {
return 'succeeded'
})
}
I’m using GCP’s Cloud Functions, Node.js is version 8.x.
I didn’t catch any errors. So, if you know the reason, please tell me that.
Thanks,
Shinnosuke