Solved

make inclusion of labels, without losing an existing label without card

  • 6 September 2022
  • 2 replies
  • 45 views

Userlevel 1
When I say an update on the card just to update the Card, all Label markings are lost. Here's the GraphiQL I'm using:

 

mutation {
updateCard(
input: {
id: 568589818,
title: "Update Card",
label_ids: ["307521167"],
},
),
{
clientMutationId
card {
id
title
}
}
}

 

But when I want to include a new label, the previous label is lost, follow the example
mutation {
updateCard(
input: {
id: 568589818,
title: "Update Card",
label_ids: ["307597207", "307597211"],
},
),
{
clientMutationId
card {
id
title
}
}
}

 

Note that the label of the first code is not maintained, if I consult the labels of the card, only the last two will be returned ( label_ids: ["307597207", "307597211"] ) .

 

I would just like to add the two labels and keep the old label. So the CARD would have the three labels ( label_ids: ["568589818", "307597207", "307597211"] )

 

Is there any way to just append labels to the CARD?

 

 

icon

Best answer by julia-pinheiro 12 September 2022, 23:17

View original

2 replies

Userlevel 7
Badge +8

With the currently listed official API documentation, the answer seems to be no, you first have to query the current card's labels and use the query you listed with all the label ids.

Userlevel 5
Badge +1

Hi!

To add a label rather than replace it, you would have to update a blank label field.

And, If the label field is already filled, when you update it by API will also replace the information.

Reply