Converting old query Items to items_page

Hi,

I have used old query Items in my App. But now I want to get that particular item name with the help of new query items_page.

Could you please help on this?

Example code:
query { items (ids: [5718828922]) { name id}}

The items root query remains operational in the new API without items_page. items_page is only used when you’re getting items from a board or a group, since there is an indeterminate number of items (and therefore you need pagination).

{ boards { items_page { items }}}

{ boards { groups { items_page { items }}}}

However, there is no need (or ability) to use items_page with the root query { items (ids: [5718828922]) { name id}} query - since you’re already specifying an array of IDs. If you have more than 100 IDs (the limit in a single root query), you wouldn’t request 500 and paginate them, you’d just batch IDs and make 5 requests of 100 IDs each.

2 Likes

Thanks for jumping in @codyfrisch! I am also just linking the items_page documentation that you can refer to @Priya :slight_smile:

Best,
Rachel

1 Like

Hi @codyfrisch & @rachelatmonday,

Thanks for the prompt response!

So , I will use root API for the above mentioned scenario.

I have one more query which is mentioned below, do we need to change the latest version for that or we can keep that version itself?

Example :
let query = query { items (ids: [${id}]) { name id updates (limit: 300){ text_body id creator_id }}};

Thanks in advance!

1 Like

That should work.

You should be able to go to the API playground and test any query there as well, very useful since its integrated with the schema as well so it warns you about most syntax errors.

1 Like