Design: Why don't I see all my components? How to use Pagination

Modified on Wed, 30 Jul at 9:33 AM

By default, 10 components will be returned.

To return more components, you can use pagination.


This example will return the first N components in your workspace. In this case, 15:

query library ($workspaceUrl: String!){
  desLibrary(workspaceUrl:  $workspaceUrl) {
    components(first: 15){
      pageInfo {
        endCursor
      }
      nodes {
        id
        name
        details {
          parameters {
            type
            name
            value
          }
        }
      }
    }
  }
}


The following example will return the components that come after the specified cursor. Cursors can be found under Components.pageInfo, as seen in the query above (endCursor)

query library ($workspaceUrl: String!, $cursor: String!){
  desLibrary(workspaceUrl: $workspaceUrl) {
    components(after: $cursor){
      pageInfo {
        endCursor
      }
      nodes {
        id
        name
        details {
          parameters {
            type
            name
            value
          }
        }
      }
    }
  }
}


This example will return the last N components in your workspace. In this case, 100:

query library ($workspaceUrl: String!, $last: Int!) {
  desLibrary(workspaceUrl: $workspaceUrl) {
    components(last: $last){
      nodes {
        id
        name
        details {
          parameters {
            type
            name
            value
          }
        }
      }
    }
  }
}


This example will return the components that come before the specified cursor.

query library ($workspaceUrl: String!, $cursor: String!){
  desLibrary(workspaceUrl: $workspaceUrl) {
    components(before: $cursor){
      pageInfo {
        endCursor
      }
      nodes {
        id
        name
        details {
          parameters {
            type
            name
            value
          }
        }
      }
    }
  }
}



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article