Dynamically fetching data from CMS #29917
Replies: 1 comment 1 reply
-
It is not possible to say "execute the page query with runtime parameter Then, you have to implement the pattern with React and client-side data fetching (of course, you can do that within Gatsby pages or components). For such patterns, I can recommend you the Another possibility would be a "pseudo load more", where the page holds all the static data (including data of statically optimized images) in a single |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, Im working on my first project with Gatsby. Im building a photographer portfolio site and Id like to fetch images in gallery, but Id like to filter them based on category as well. I store my images on Strapi CMS and use graphql plugin.
Currently I fetch 10 images via page query at the build time, hovever Id like to implement infinite scrolling, so when user scrolls down another 10 photos will be loaded. Also if user clicks on some category only images in that category will be loaded.
How should I go about this? Is there a way to trigger page query with variable (category) when user scrolls down the page?
Beta Was this translation helpful? Give feedback.
All reactions