API version 2023-10: column_values connected board item_id type does not accept String and returns Int

Hello,

In 2023-10 there is this change: “Type changed: All IDs now use the ID type, not Int.”

This page says: Migration guide - 2023-10

Version 2023-10 has some type changes to improve the consistency of our GraphQL API.

Specifically, we aligned our schema so all fields representing numerical IDs now use the ID type. As a return value, it’s expressed as a string. When used in an argument (input), it accepts either string or integer values.

If your app is strongly typed, your code may throw an error when this type changes because your application will expect an integer but receive a string.

To solve this, please review your API calls to check if you use any affected fields. Then, ensure your code accepts both integer and string values.

Note: Even though you could convert the strings to integers, we don’t recommend it, as the structure of these IDs may change in the future.

The problem is that the column_values JSON string only accepts Int type and gives ColumnValueException if it is String:

"column_values": "{\"connect_boards\":{\"item_ids\" : [\"123456789\"]}}"

response:

{
  "error_code": "ColumnValueException",
  "status_code": 200,
  "error_message": "There are items that are not in the connected boards",
  "error_data": {}
}

It works only with Int type:

"column_values": "{\"connect_boards\":{\"item_ids\" : [123456789]}}"

Also, it returns Int type when querying which was supposed to be a String:

              "column_values": [
                {
                  "id": "connect_boards",
                  "value": "{\"linkedPulseIds\":[{\"linkedPulseId\":123456789}]}"
                }
              ]

Maybe I’m missing something but this seems like a bug.

Thanks
G

Good catch.

I’d recommend sending this to appsupport@monday.com since that is the developer support email.

Also this post may get more proper attention if posted in monday Apps & Developers - monday Community Forum. You should be able to edit the post and change where its posted.

I think they missed that connect boards columns use IDs in their value. That said, for querying check out the V2 style Connect boards for getting the value.

query {
  complexity{query}
  items(ids: "123455688") {
		column_values(ids: "link_to_board_2") {
      ... on BoardRelationValue {
        linked_item_ids
        linked_items {
          id
          board {
            id
          }
        }
      }
    }
  }
}

which returns the follow that does include the item Ids as strings.

{
  "data": {
    "complexity": {
      "query": 12031
    },
    "items": [
      {
        "column_values": [
          {
            "linked_item_ids": [
              "5190172400"
            ],
            "linked_items": [
              {
                "id": "5190172400",
                "board": {
                  "id": "4456252030"
                }
              }
            ]
          }
        ]
      }
    ]
  },
  "account_id": 98765234
}

the linked items is an array of items, so you can do full queries like you would items such as getting the board ID that item is on. Just remember you can only go 6 levels deep in a query total, and the deeper you go, the more likely your query complexity is to skyrocket. Sometimes its just more efficient to do multiple queries.

1 Like

Thank you, Cody for your helpfulness!

I have moved it to that forum now. I wanted to make sure I’m not missing something before bothering the developers directly.

You are right with the V2 style, I didn’t really look closely into it yet. That looks OK as you said.

I’m updating my code for 2023-10 and wanted to do a bare minimum of change. And my connected boards are small and static and read them once at startup.

In any case this V1 method is not deprecated (yet) and will fail if they make the ID type alphanumeric in the future.

Thanks
Greg

You definitely could wrap all the IDs in a Number() before putting them into the column. I’m assuming you’re iterating a list of them (or its just one) so it should be trivial to force to numbers for the time being.

I would not be shocked (and this is speculation only) if in a future API there is a special mutation for connecting items connect_item_to_item(item_id: "123213", board_id: "123213", column: "connect_boards", connected_item: "123213"){} because i believe connect board columns are going to become a representation of a deeper data structure (may already be) that connects items - rather than the actual connection.

2 Likes

Right, I made it work by using Int, that’s not a problem, it’s just a ticking bomb if the ID will contain letters later on.

1 Like