I've browsed around the issues and roadmap for a while looking for more info about pagination and tags (and tag collection pages). This seems to be a feature that has been rolled out in 1.0, but where can I find a concrete demo and sample code for it.
Do I need to migrate to GraphQL from the old file-hierarchy -based structure to get access to these features?
Are there any migration guides from 0.* to 1.0?
As a sidenote I think this project needs a more indepth readme/documentation, the current readme is more of a sales pitch and doesn't really cover the features of 1.0 from what I've read. I think GraphQL has a pretty good documentation, check it out.
Hey! Thanks for stopping by. Pagination and tags are indeed supported in 1.0. The best place to get started on understanding 1.0 is this issue and its subissues: https://github.com/gatsbyjs/gatsby/issues/419
There's not a migration guide yet as 1.0 is still a moving target. My plan is that we'll publish an upgrade guide along with the first beta as that'll signify APIs etc are mostly stabilized. The above 1.0 issue has several sites which are kept up-to-date with changes that you can check out.
In depth documentation is also in progress. Check out https://www.gatsbyjs.org for the docs-in-progress. Any help you can lend there is appreciated!
You might also be interested in this case study on an example site built with 1.0 https://www.gatsbyjs.org/blog/gatsbygram-case-study/
Hi! Thanks for your response, I'll check out the links for further info about this. The issues (issues tab) are a little confusing for newcomers like me since gatsby's in the middle of a overhaul by the looks of it.
Thanks for developing this awesome project!
Congrats on the launch!
Any resource on how to incorporate pagination in a blog archive without having to query all the data with GraphQL? I've implemented it but I'm querying every blog post instead of just getting the blog posts I need.
Skip/limit are your friends. Want to work on adding explicit support for
pagination soon but in the meantime, search the www site for examples
On Fri, Jul 7, 2017, 3:51 PM Chiedo notifications@github.com wrote:
Congrats on the launch!
Any resource on how to incorporate pagination in a blog archive without
having to query all the data with GraphQL? I've implemented it but I'm
querying every blog post instead of just getting the blog posts I need.—
You are receiving this because you modified the open/close state.Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/785#issuecomment-313811061,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEVhz0pqRC9rlOL5o-HpYlepnrov5Vtks5sLraFgaJpZM4M4cCT
.
Cool @KyleAMathews
I actually tried skip and limit but couldn't get graphql to accept variables for the page number. I was probably doing something wrong.
I could only use static queries in the components so couldn't tell the query to skip 1 for page 1, skip 2 for page 2 etc.
I'll keep looking though! I'll see what I see in the codebase. :)
As a follow up to this for record keeping purposes:
skip and limit (may not matter at all in practice), I'm led to believe that one would need to create each blog archive page (1,2,3 etc) by using gatsby-node.js and hooking into one of the functions. ... maybe createPages? My attempts to use skip and limit and have them read data from my props did not work as I was not able to interpolate any strings into the query (maybe due to limitations, maybe due to my lack of knowledge).@chiedo yeah you can only pass graphql variables when creating pages https://www.gatsbyjs.org/docs/bound-action-creators/#createPage
Any updates on this? Some sort of tutorial to get started with pagination that wouldn't grab everything at once. An approach where you'll just get pages automatically generated (/blog/page-2, /blog/page-3)?
Even some sample code on doing pagination will work for me
That's not trivial @theiliad. You'd need to do it with a gatsby-node createPage script.
If you need pagination, without those pages getting automatically generated though, this is a good starter https://github.com/gatsbyjs/gatsby/blob/master/examples/gatsbygram/src/pages/index.js
Cool, it'd be cool to make a plugin for that, I'll look into it
Most helpful comment
Cool, it'd be cool to make a plugin for that, I'll look into it