GraphQL Parse error on \"ids\" (IDENTIFIER)

Hello,

I have a board and can query the column names fine (1st code block below + image). But when I try to query the column values I get "“message”: “Parse error on "ids" (IDENTIFIER) at [1, 14]” (2nd code block below + 2nd screenshot). Any help is appreciated, thx!!

{
“query”:
“query boards(ids: 6035791171) {items {column_values {column {id title} id type value}}}”
}

{
“query”:
“query boards(ids: 6035791171) {items(limit: 50) {column_values(ids:[name, project_owner]) {title value}}}”
}

non-integer IDs must be quoted, look in your column_values(ids: [columnID]) should have quotes around each column Id in the array. Also board, item, etc. IDs accept strings not just integers. I would recommend treating them as such, since monday returns them as strings not integers in queries.

I also suggest https://graphql.org/learn/queries/#variables for a better way to pass in values that avoids the need to ensure things are escaped appropriately. This crops up with column changes and such where you need to send in JSON (send the JSON string as a variable, not part of the mutation string).

Secondly, you can no longer embed items directly in boards but must use items_page.

Lastly, you cannot return the item name as a column value, it is a property directly on an item.

{
 items {
   name
 }
} 
1 Like

Thx Cody. I made the changes you suggested. Using items_page without any compare_value, and adding quotes for non integer fields (seems I must use "COLUMN") I’m still getting parse errors. Do you see any problems with this?

The query should be something like this. Also the error is because rules is an array of objects, since you’re not trying to filter by column value, just omit the query_params entirely. You specify the column Ids you want as arguments to the column_values subquery inside the items.

query {
  boards(ids: ["123123"]) {
    items_page (limit: 10) {
      items {
        id
        name
        column_values(ids: ["text4"]) {
          id
          value
        }
      }
    }
  }
}

Thx. I did try in Postman using GraphQL as well as raw. Looks like it’s treating items_page as a field:

I’m a little bit closer. I can get the IDs but column values still null. Any ideas?

your postman is not sending the API version header for 2024-01. So items_page isn’t going to work.

Its odd you’re still able to use the old API version but I don’t control that.

you need an “api-version” header with the value “2024-01” in post man.

1 Like

Thx Cody!!! Works fine now. I sincerely appreciate all your help!!!

1 Like

Thank you so much @anon29275264 !!

1 Like