algolia / gatsby-plugin-algolia

A plugin to push to Algolia based on graphQl queries
https://yarn.pm/gatsby-plugin-algolia
Apache License 2.0
177 stars 45 forks source link

Working with Prismic's 20 API limit #77

Closed andrecalvo closed 3 years ago

andrecalvo commented 4 years ago

Hey,

I'm using this plugin with the Prismic API. It all works fine but the issue is that Prismic limits the documents returned via their API to 20.

Is there a way that I can index more than 20 documents at once programatically?

Haroenv commented 4 years ago

Why does prismic limit the API like that, do you have docs for this?

andrecalvo commented 4 years ago

https://prismic.io/docs/graphql/query-the-api/paginate-your-results

The Prismic GraphQL API returns a maximum of 20 documents per request. There is no way to increase this number, so this page explains how you can retrieve more than this initial 20 documents.

You can get around this when using the createPage function by recursively querying based on the end cursors for example.

I don't think this is possible with this library though?

Haroenv commented 4 years ago

Since you’ve created the pages, there should be a way to query for those too, and not directly back to prismic. Maybe you can also explicitly save the downloaded info somewhere?

andrecalvo commented 4 years ago

Ah, nice idea :) Thanks

Haroenv commented 3 years ago

I assume this is solved now!