# Cache offsetLimitPagination with nested objects

**URL:** <https://community.apollographql.com/t/cache-offsetlimitpagination-with-nested-objects/1561>\
**Category:** Client SDKs\
**Tags:** client, web\
**Created:** [October 4, 2021, 6:42pm UTC](https://community.apollographql.com/t/cache-offsetlimitpagination-with-nested-objects/1561 "2021-10-04T18:42:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivenus](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/ivenus/32/1011_2.png) [@ivenus](https://community.apollographql.com/u/ivenus)\
**Post date:** [October 4, 2021, 6:42pm UTC](https://community.apollographql.com/t/cache-offsetlimitpagination-with-nested-objects/1561/1 "2021-10-04T18:42:11Z")

</div>

Hello, I am trying to implement `offsetLimitPagination` function to `GetApplicationComments` query. The problem comes when I have nested comments (`items`). Comment typename is `ApplicationComment`.

In this situation `getApplicationComments` query returns data that is an empty array.

![image](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/1/17430a8ac6ff27f0431528059fc646e175250c30.png)

```auto
query GetApplicationComments($offset: Int! $limit: Int!) {
  getApplicationComments(offset: $offset limit: $limit) {
    count
    items {
      id
      message
    }
  }
}

new InMemoryCache({
  typePolicies: {
    ApplicationComment: { keyFields: ["id"] },
    Query: {
      fields: {
         getApplicationComments: offsetLimitPagination(),
      },
    },
  },
})

```
