Query All Your Documents

This page shows examples of how to query all the documents in your prismic.io repository.

Before Reading

This page assumes that you've already imported the Prismic library and retrieved the Client object. If you want to learn how to do this, then refer to the How to Query the API page.

Without Options

If you need to query all of the documents in your repository, you can just run an empty query.

Copy
client.query('').then(res => {
    // res is the response object, res.results holds the documents
})

With Options

You can add options to this query. In the following example we allow 100 documents per page for the query response.

Copy
client.query('', { pageSize : 100 }).then(res => {
  // res is the response object, res.results holds the documents
})