This is my Javascript:
const query5 = 'mutation {create_column (board_id: 1163502014, title: "ding", column_type: status, defaults: "{\\"labels\\":{\\"0\\":\\"Working ffffonit\\",\\"1\\":\\"Done\\",\\"2\\":\\"Stuck\\",\\"14\\":\\"\\",\\"12\\":\\"\\",\\"7\\":\\"\\"},\\"labels_colors\\":{\\"0\\": {\\"color\\":\\"#fdab3d\\",\\"border\\":\\"#E99729\\",\\"var_name\\":\\"orange\\"},\\"1\\":{\\"color\\":\\"#00c875\\",\\"border\\":\\"#00B461\\",\\"var_name\\":\\"green-shadow\\"},\\"2\\": {\\"color\\":\\"#e2445c\\",\\"border\\":\\"#CE3048\\",\\"var_name\\":\\"red-shadow\\"},\\"14\\": {\\"color\\":\\"#784BD1\\",\\"border\\":\\"#8F4DC4\\",\\"var_name\\":\\"dark-purple\\"},\\"12\\": {\\"color\\":\\"#FF158A\\",\\"border\\":\\"#E01279\\",\\"var_name\\":\\"dark-pink\\"},\\"7\\": {\\"color\\":\\"#579bfc\\",\\"border\\":\\"#4387E8\\",\\"var_name\\":\\"bright-blue\\"}}}" ) {id}}';
fetch("https://api.monday.com/v2", {
method: 'post',
headers,
body: JSON.stringify({
'query' : query5
})
})
.then(res => res.json())
.then(res => console.log(JSON.stringify(res, null, 2)));
})
I copy and past the mutation exactly into the API playground and it works. However, when I run the mutation through the JavaScript fetch I get:
“Parse error on ":{" (STRING) at t1, 101]”