Skip to main content
Solved

GraphQL: How to clear a connection field value


ramongb

Hi there!

 

Im trying to get a card and clear the value of a field using GraphQL. The field is not string or number, it is a pipe connector. I’m not trying to delete the relation field, just clearing it out.

 

I’m trying the following:

mutation { updateFieldsValues(input: {nodeId: "{cardId}", values: {fieldId: "{name}", value: [] }}) { clientMutationId } }

 

I have tryed usin “” or [“”] in the value but I got always an error sayin is an invalid input.

Have anyone did this before?

Best answer by Lais Laudari

I got it!
Can you try this one:
 

mutation {updateCardField( input: {card_id: xxxxx, field_id: "xxxx", new_value: null }) {  clientMutationId  success}}


 

View original
Did this topic help you find an answer to your question?

5 replies

Lais Laudari

Hi @ramongb!
Did you try to fill out it as null? 
value: [null]


ramongb
  • Author
  • New Member
  • 6 replies
  • August 28, 2023

Hi @Lais Laudari 

Thanks for your answer, but it does’t work either:

 

Query:

mutation {   updateFieldsValues(     input: {nodeId: "782947385", values: {fieldId: "booking", value: [ null ]}}   ) {   clientMutationId   } }

 

Result:

mutation {

  updateFieldsValues(

    input: {nodeId: "782947385", values: {fieldId: "booking", value: NULL}}

  ) {

    clientMutationId

  }

}

 

I also triyed NULL and [NULL] but I got:

{

  "errors": [

    {

      "message": "Argument 'value' on InputObject 'NodeFieldValueInput' has an invalid value (NULL). Expected type '[UndefinedInput]'.",

      "locations": [

        {

          "line": 3,

          "column": 42

        }

      ],

      "path": [

        "mutation",

        "updateFieldsValues",

        "input",

        "values",

        0,

        "value"

      ],

      "extensions": {

        "code": "argumentLiteralsIncompatible",

        "typeName": "InputObject",

        "argumentName": "value"

      }

    }

  ]

}

 

What else can I try?

 

 

 


Lais Laudari

I got it!
Can you try this one:
 

mutation {updateCardField( input: {card_id: xxxxx, field_id: "xxxx", new_value: null }) {  clientMutationId  success}}


 


ramongb
  • Author
  • New Member
  • 6 replies
  • August 28, 2023

I works!!!!

 

Ok I hadn't considered updateCardField

 

Thanks a lot @Lais Laudari 


Ezequiel Souza
Forum|alt.badge.img+14

It’s so good to see this community working and sharing knowledge.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings