Why this json is valid:
{
"query":"mutation{ createCard(input: {pipe_id: 426174 fields_attributes: [{field_id: \"o_que\", field_value: \"Igor\"}{field_id: \"idade\", field_value: \"21\"}{field_id: \"cidade\", field_value: \"Vila Velha - ES\"}] parent_ids: [\"2735966\"] }) { card {id title }}}"
}
And this is rendering invalid in the tests I do:
{"query":"mutation {
createTableRecord(input: {
table_id: \"RL-p4Ud_\"
title: \"Igor Oliveira\"
due_date: \"2018-04-10T11:04:57-03:00\"
fields_attributes: [{
field_id: \"nome_completo\",
field_value: \"Igor Oliveira\"
}, {
field_id: \"e_mail\",
field_value: \"[email protected]\"
}, {
field_id: \"telefone\",
field_value: \"279800002\"
}]
}) {
table_record {
id title
}
}"}
The error is as follows:
Invalid characters found. [Code 18, Structure 4]
The idea is that the query has all the mutation as if it were a string.
In PHP I'm creating this:
$query = '{"query":"';
$query .= 'mutation {
createTableRecord(input: {
table_id: \"RL-p4Ud_\"
title: \"'.$nomecompleto.'\"
due_date: \"'.date('c').'\"
fields_attributes: [{
field_id: \"nome_completo\",
field_value: \"'.$nomecompleto.'\"
}, {
field_id: \"e_mail\",
field_value: \"'.$email.'\"
}, {
field_id: \"telefone\",
field_value: \"'.$telefone.'\"
}]
}) {
table_record {
id title
}
}';
$query .= '"}';