Mutating columns in playground

Hi

I’m trying to get this change_multiple_column_values API call to work in the playground but I keep getting an error:

{
  "errors": [
    {
      "message": "Unexpected token '<', \"<!doctypeh\"... is not valid JSON",
      "stack": "SyntaxError: Unexpected token '<', \"<!doctypeh\"... is not valid JSON"
    }
  ]
}

here’s the GraphQL I am sending in the playground:

mutation {
  change_multiple_column_values(
    board_id: 4457668941
    item_id: 5932686117
  	column_values: {
      numeric0:0
  	}) {
    	id
  	}
}

Not sure why what I am passing is invalid JSON. I’ve tried a bunch of variations, wrapping the key in quotes, both key and value in quotes, the whole bit of JSON in quotes. When I do that I get a different error complaining about the quotes.

Would like to emphasize I just need this to work in the dev Playground for now.

Any help would be appreciated.

1 Like

The value of column_values must be a JSON string, not an object. You may want ot run it through a JSON.stringify online first. or investigate using GraphQL Variables instead of string manipulation. Youll still need to make JSON but you lose the complexity of embedding JSON inside the graphql query string (while the query looks like an object, it is just a string)

1 Like

Thanks @anon29275264 I figured it out. Also didn’t help I was using the wrong column id (numbers0, not numeric0)…doh!

1 Like

That would do it!

1 Like