Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pageSize customization #435

Closed
matthewlein opened this issue Aug 27, 2021 · 6 comments
Closed

Add pageSize customization #435

matthewlein opened this issue Aug 27, 2021 · 6 comments
Labels
enhancement V4 Related to v4
Projects

Comments

@matthewlein
Copy link

I have received an email that prismic will be blocking large api responses soon. I believe some of these are coming from the primsic-gatsby plugin to build all the prismic pages. The easiest solution is lowering pageSize from 100 to something smaller, but I don't think this can be configured in the plugin.

I would like to be able to set pageSize in the config to any number and have it use that to build the pages.

@angeloashmore
Copy link
Member

Hey @matthewlein, thanks for the suggestion. This sounds like a good idea.

I'm currently refactoring parts of the plugin that currently would conflict with adding a pageSize option. I'll leave this issue open for now and will add the option once the refactor is ready to merge. This shouldn't be long - hopefully within the week.

Thanks!

@angeloashmore angeloashmore added the V4 Related to v4 label Aug 30, 2021
@angeloashmore angeloashmore added this to Backlog in Development via automation Aug 30, 2021
@angeloashmore angeloashmore moved this from Backlog to To do in Development Aug 30, 2021
@matthewlein
Copy link
Author

This is currently blocking all my builds. Can you point me to where I can hack a hardcoded value into the plugin in a fork until this is added? I can't make any sense of this repo and code...

@angeloashmore
Copy link
Member

@matthewlein Sorry for the delay! I'll add the option and worry about updating it for the refactor later. I'll post here once it's published.

@angeloashmore
Copy link
Member

@matthewlein Thanks for your patience! The PR has been merged (#456).

You can update to the latest versions which now has a pageSize option.

  • gatsby-source-prismic: v4.2.0
  • gatsby-plugin-prismic-previews: v4.2.0

Then in gatsby-config.js:

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-source-prismic',
      options: {
        pageSize: 50,
      }
    },

    // If you use gatsby-plugin-prismic-previews:
    {
      resolve: 'gatsby-plugin-prismic-previews',
      options: {
        pageSize: 50,
      }
    },
  ],
}

Development automation moved this from To do to Done Oct 4, 2021
@matthewlein
Copy link
Author

@angeloashmore Thanks for the quick turnaround!

The update turned out to be pretty lengthy, I was on 3.x, but it all worked in the end. Builds resumed!

@angeloashmore
Copy link
Member

Great! Glad to hear it's working for you.

Hopefully you found the V3 to V4 migration guide. In case you didn't, here's a reference: https://prismic.io/docs/technologies/gatsby-source-prismic-v3-to-v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement V4 Related to v4
Projects
No open projects
Development

No branches or pull requests

2 participants