Hi all,
I’m trying to create items on my own board using garphql, axios and nodejs.
for some reason when i try to send the columnValues i get the followong errMessage:
errors: :
{
message: 'Variable columnValues of type JSON! was provided invalid value',
locations: :Array],
value: null,
problems: :Array]
}
],
and here is what i’m doing 🙂
const createItem = {
query: `
mutation ($boardId: Int!, $groupId: String!, $itemName: String!) {
create_item (
board_id: $boardId,
group_id: $groupId,
item_name: $itemName,
) {
id
}
}`,
variables: {
boardId: +BOARD,
groupId: "topics",
itemName: `${title}`,
}
}
axios.post(`${URL}`, createItem, {
headers: {
Authorization: `${KEY}`
}
}).then(res => {
console.log(res.data.data.create_item.id)
let itemId = res.data.data.create_item.id;
const fillItem = {
query: `
mutation ($boardId: Int!, $itemId: Int!, $columnValues: JSON!) {
change_multiple_column_values (
board_id: $boardId,
item_id: $itemId,
column_values: $columnValues
) {
id
}
}`,
variables: {
boardId: +BOARD,
itemId: +itemId,
groupId: "topics",
columnValues: JSON.stringify({
text8: problem_type,
text9: problem_sub_type,
text7: third_level_category,
text5: description,
text4: assigned_group,
text1: responsability,
text6: request_user,
text61: submit_user,
text97: request_user_email,
text3: request_user_cellphone,
text33: module_klh,
text50: df_phone_number,
})
}
}
axios.post(`${URL}`, fillItem, {
headers: {
Authorization: `${KEY}`
}
}).then(res => console.log(res.data.errorsr0]))
.catch(err => console.log(err.data))