Solved

Error 3000 - Algo deu errado GraphQL

  • 28 May 2021
  • 3 replies
  • 611 views

Userlevel 2

Boa tarde a todos, estou tentando criar um card via graphql, só que a api está me retornando erro. Alguem sabe oque pode ser?

 

mutation {  
createCard(
input: {
pipe_id: {{pipe_code}}
fields_attributes: [
{
field_id:"c_digo_da_entrega_no_fornecedor",
field_value:"""{{table4.selectedRow.data.freight_partner_external_id}}"""
},
{
field_id:"valor_do_frete",
field_value: """{{table4.selectedRow.data.freight_price?table4.selectedRow.data.freight_price:0}}"""
},
{
field_id:"hor_rio_limite_de_chegada_para_carregamento_1",
field_value:"""{{table4.selectedRow.data.freight_scheduled_delivey_datetime}}"""
},

{
field_id:"link_de_acompanhamento_1",
field_value:"""{{table4.selectedRow.data.freight_tracking_link}}"""
},
{
field_id:"nome_do_motorista_1",
field_value:"""{{table4.selectedRow.data.freight_delivery_point_of_contact}}"""
},
{
field_id:"contato_do_motorista_1",
field_value:"""{{table4.selectedRow.data.freight_delivery_poc_phone}}"""
},
{
field_id: "identify_autom_tico",
field_value: """{{table5.selectedRow.data.identify}}"""
},
{
field_id: "itens_da_retirada_1",
field_value:"""{{item_value.value}}"""
},

{
field_id:"coment_rios",
field_value:"""{{table4.selectedRow.data.client_delivery_notes}}"""
},
{
field_id:"endere_o_de_retirada"
field_value:"""{{table5.selectedRow.data.retirada}}"""
},
{
field_id:"quantos_endere_os_de_retirada",
field_value:"1"
},
{
field_id:"contato_rdo_autom_tico",
field_value:"""{{table5.selectedRow.data.name}}"""
},
{
field_id:"respons_vel_da_obra_autom_tico",
field_value:"""{{table5.selectedRow.data.phone_number}}"""
},
{
field_id:"nome_da_obra",
field_value:"""{{ table5.selectedRow.data.name }}"""
}
]
}
){
card {
id
}
}
}

O erro foi esse aqui:

 

{
"data": {
"createCard": null
},
"errors": [
{
"message": "Algo deu errado",
"locations": [
{
"line": 2,
"column": 7
}
],
"path": [
"createCard"
],
"code": 30000,
"type": "ExecutionError"
}
]
}

 

icon

Best answer by Marcos Carvalho 13 August 2021, 16:49

View original

3 replies

Userlevel 6
Badge +6

Hey @login7 , how are you?

It seems that some field value is being sent in a invalid format.

 

Please double check your fields types and inputs to make sure everything is ok. 

 

Here something to help you on it: 

 

 

 

 

If you need anything else, please let me know.

 

 

 

@Marcos Carvalho, can u help me with another doubt?
I’m trying to create card via API, but one of fields of card is “connection fileds” and i don’t know where i find the integer value to use to select the right value i want in database. Do you know?

Userlevel 6
Badge +6

hey @xp-hf ,

 

if you want to list all the records in a database to be used in your mutation, you can do something like this: 

 

{
table(id: "4asda4w3") {
table_records {
edges {
node {
id
}
}
}
}
}

You’ll get in return:


 

{
"data": {
"table": {
"table_records": {
"edges": [
{
"node": {
"id": "96385214"
}
},
{
"node": {
"id": "74185296"
}
},
{
"node": {
"id": "87456985"
}
},
{
"node": {
"id": "87654321"
}
},
{
"node": {
"id": "12345678"
}
}
]
}
}
}
}

 

 

then you can use one of these ids in your mutation:

 

mutation{
createCard(
input: {
pipe_id: 219739
fields_attributes: [
{field_id: "connector", field_value:[12345678]}
]
}
) {

card {
id
title
}
}
}

 

 

hope it helps you :smiley:

Reply