Getting unexpected string from groups query

Hello developers,

I’m trying to query groups, noticing some unexpected values in response for id key. This I’ve been noticing only from yesterday and used to work fine before when I tried. Thus wanted to check if anything wrong on my end (or) something breaking here.

Here is my query,

getGroups ({ context, metadata }) {
    return {
      method: 'post',
      url: 'https://api.monday.com/v2',
      headers: getCommonHeaders(metadata),
      data: {
        query: `query {
          boards (ids: ${context.boardId}) {
            groups {
              title
              id
            }
          }
        }`
      }
    };
  },

And the response looks like this, (just attaching the group part of it)

[
    {
        "title": "Group Title",
        "id": "topics" // expecting this to be something like 1210777 
    }
]

So when I try to make further calls with this id, it fails (say fetching items in a group)

Can someone confirm if anything wrong on my end?

Thanks in advance.

GroupIds are just strings (like columnIds). Nothing unexpected here.

1 Like

Update:

Sorry, from other community threads related to groups - I found group ids can be such strings. Correct me if I’m wrong.

Then, when I pass these ids in query with double quotes (basically formatted as string) it works fine. Now that my blocker is resolved, I’m just curious to know why only group ids are returned in such format whereas ids of items, boards, etc seem to be valid integer kind of strings.

Thanks

Think of groupIds similarly to columnIds - it’s a string that’s similar to the group title, but it is not the group title. There are not normally that many groups (or columns) so like the columnId, monday tries to make the groupId descriptive.

There can be many board and items, so they just use an incrementing integer for the ids in these cases.

1 Like