Error using GraphQL

Greetings!
I’m trying to use the api version 2 of your plataform, and i’m receiving the following error:

Syntax Error GraphQL request (1:105) Expected :, found String “: {”

I’m using python version 3.6 with gql module.
This occurs when i try a mutation in a board.
Here is the query:
query = gql(“”" mutation {change_multiple_column_values (board_id: XXXXXXXX , item_id: XXXXXXX, column_values: “{“dma2”: {"index": "teste"}}”) {id}} “”")

The query to select data is ok when i test with the same module and script.

Could you please help-me with this problem?

hey @brunoinvestflex,
you need to use escaping when using the column value field, try this:

query = gql(""" mutation {change_multiple_column_values (board_id: XXXXXXXX , item_id: XXXXXXX, column_values: "{\"dma2\": {\"index\": \"teste\"}}") {id}} """)

Hi Ayelet. Thanks for yout answer!
i tried at yout way, and got the same error!!

graphql.error.syntax_error.GraphQLSyntaxError: Syntax Error GraphQL request (1:104) Expected :, found String “: {”

1: mutation {change_multiple_column_values (board_id: XXXXXXXX, item_id: XXXXXXXX, column_values: “{“dma2”: {“index”: “teste”}}”) {id}}

is “dma2” the ID of your column? you can get the column ids using this query

boards (ids: 123456){
  columns{
    id
    title
    type
    settings_str
  }
}

what type is your column?
it seems like status column and if so, you need to either use the index which is the status color index (you can see in in the settings) or the label text.
so it should look like: {“index”: 0} or {“label”: “teste”}

This are the column settings:

{u’settings_str’: u’{}’, u’type’: u’text’, u’id’: u’dma2’, u’title’: u’DMA2’}

My mutation is wrong even with this settings?

according to your settings “dma2” column is a text column. for text column you don’t need any json just the text value, like so:

"{\"dma2\": \"teste\"}

each type has a different way to update it, check it out here: https://monday.com/developers/v2#column-values-section

I’m using this query:
query = gql(" mutation {change_multiple_column_values (board_id: XXXXXXXX, item_id: XXXXXXXX, column_values: “{“dma2”:“teste”}” ") {id}} ")

And got the same error :frowning:

graphql.error.syntax_error.GraphQLSyntaxError: Syntax Error GraphQL request (1:104) Expected :, found String “:”

1: mutation {change_multiple_column_values (board_id: 75059531, item_id: 75059577, column_values: "{“dma2”:“Sample text”}) {id}}

did you try performing the same query in the GraphiQL explorer?
you can find it here: monday.com

don’t forget to escape the strings like so: "{\"dma2\": \"teste\"}

It worked when i captured part of the mutation query from the payload of whe tester that you send-me. Thanks very much!!! :slight_smile:

2 Likes