New `items_page` does not accept specified item ids

As shown in the attached image, even though the documentation says the items_page accepts an array of item ids, when added, it throws an error.

Still on item ids, the new items_page will only work under a boards query which unfortunately is a step backwards from the previous item query where all you needed to know is the item id to get information about the item.
What happens when you have multiple item ids which are located in different boards? Does it mean you will have to query for all the board ids and then in the boards query, include all the board ids?
So in effect, the final query might look like this:

{
  boards(ids: [MULTIPLE_BOARD_IDS_HERE]) {
    items_page(ids:[ITEM_IDS_FROM_THE_DIFFERENT_BOARDS], limit: 3) {
      cursor
      items {
        id
        name
      }
    }
  }
}

You need to send the item IDs in the query_params argument:

query {
  boards (ids:4579962334) {
    items_page(query_params:{ids:4579963913}) {
      items {
        id
        board {
          id
        }
      }
    }
  }
}

As for why it’s a step backwards; I don’t fully understand. In the previous version you also had to nest the items query inside a boards query. What’s missing?

You do still have the option of returning items by ID directly, using the root items query:

query {
  items (ids:12345) {
    id
  }
}
1 Like

Hello @dipro,

Thank you for your answer. I did try your answer and I was expecting the item id and name as part of the result but got nothing.

Also, concerning the items query, do I correctly understand that, items can still be used as a root query, provided an id or ids are specified and must not always be nested under the new items_page query?
If yes, what does this part of the documentation mean then?

  1. Queries that use items must nest them in the items_page object

Hey, thanks for the quick response.

Regarding the items query – yes, you are correct. You can still use items as a root query.

Regarding the documentation – great catch, I wrote that sentence and realize how it’s unclear/wrong. :slightly_frowning_face: I will update it to the following:

Queries that use items inside the boards or groups object must nest them in the items_page object

Regarding getting no data for the above item – looks like a mistake in your query or a bug. Can you do the following basic troubleshooting and, if it still fails, open a ticket?

  • Check the item and board IDs are accurate
  • Check the logged-in user has access to the items and boards
  • Check that the item has not been deleted/archived
  • Check that the board or group has not been deleted/archived
1 Like

Hello @dipro,
Thanks for the response and also the troubleshooting ideas. It helped. I had mistakenly used the wrong board id.
Looking forward to the updates in the documentation

1 Like

4 posts were split to a new topic: Trouble using new API version

Hello @dipro,

If I understand correctly, previous queries for groups that looked like this

{
  boards(ids: BOARD_IDS) {
    groups(ids: [GROUP_IDS]) {
        items {
          id
        }
    }
  }
}

should now look like this:

{
  boards(ids: BOARD_IDS) {
    groups(ids: [GROUP_IDS]) {
      items_page {
        cursor
        items {
          id
        }
      }
    }
  }
}

The only problem is, the latter does not work and the api throws an error that "Field 'items_page' doesn't exist on type 'Group'"

Hello there @kolaai,

The second query should work now. We had a small issue that was fixed.

I just tested the following query succesfully:

{
  boards(ids: 1234567890) {
    groups(ids: ["topics"]) {
      items_page {
        cursor
        items {
          id
        }
      }
    }
  }
}

Let me know how that goes!

Cheers,
Matias

1 Like

Alright @Matias.Monday . Thank you :slight_smile:

3 Likes

Happy to help @kolaai !

2 Likes