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