I’ve been trying to get the create_item mutation to work for a little while now but the server response tells me there’s a JSON parse error. I’ve tried escaping my column values manually and with JSON.stringify() but I always get the same error. Any help is much appreciated! Here’s my query:
const mutation = `
mutation {
create_item(board_id: MY_BOARD_ID, item_name: "a new item", column_values: "{\\"check\\": {\\"checked\\": \\"true\\"}}") {
id
}
}
`;
return fetch('https://api.monday.com/v2/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': process.env.MONDAY_TOKEN,
},
body: JSON.stringify({ query: mutation }),
})
.then(response => response.json());
And here’s the error I get back in the response:
errors: [
{
message: 'Parse error on ": {" (STRING) at [3, 84]',
locations: [Array]
}
]