Skip to main content

Error using GraphQL

  • August 30, 2019
  • 8 replies
  • 3581 views

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?

This topic has been closed for replies.

8 replies

Ayelet
Forum|alt.badge.img
  • monday.com Team Member
  • September 2, 2019

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}} """)


  • Author
  • New Participant
  • September 2, 2019

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}}


Ayelet
Forum|alt.badge.img
  • monday.com Team Member
  • September 2, 2019

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”}


  • Author
  • New Participant
  • September 2, 2019

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?


Ayelet
Forum|alt.badge.img
  • monday.com Team Member
  • September 2, 2019

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


  • Author
  • New Participant
  • September 2, 2019

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 😦

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}}


Ayelet
Forum|alt.badge.img
  • monday.com Team Member
  • September 2, 2019

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\\"}


  • Author
  • New Participant
  • September 2, 2019

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