View more context

 

blueo

if so you may need :

  1. query myQuery {
  2. Regions {
  3. ID,
  4. Title
  5. }
  6. }
Bjorn Bojumble

yeah that was part of it. Thanks I have it kind of working now

👍 (1)
Anthony van Beek

Hey there! Going headless with React… what is a good solution to getting the pages from the CMS (nested pages)? All pages in one request or request per page? Say over +- 150 pages.

gened

I’d say it depends on your FE setup and what you want to achieve. A static site? or Next.js, CRA? I use gatsby and have a multiple sites one with 750+ pages and found it was far to expensive to build out each page with all the round trips to Silverstripe graphql. Instead build the data on the server and build the static site in one request from said built data

Anthony van Beek

@gened thanks, how do you trigger your builds for the pages? Once a day? manually?

gened

It’s not quite live yet, but part of CI for the gatsby side of things. For data, will build chunks based on data changes and will also trigger gatsby builds via cron/event

wmk

do you cache json data or how is it structured?

Bjorn Bojumble

Heres an interesting one, how would one use Image functions via graphql? Esp if the images need to resize at different breakpoints. Or the view needs several sizes of the same image?

unclecheese

But yeah, generally speaking, if you're doing decoupled, you wouldn't be colocating your uploaded assets with your CMS

Bjorn Bojumble

Should I just return 3 sizes via Graphql? small, med and large?

gened

@Bjorn Bojumble I have a lambda function that you can pass width and height and the image path in s3 (which is where the assets are already), similar to how cloudinary works - https://cloudinary.com/. You could also migrate your images or hold references in something like cloudinary 🙂

Show 2 attachment(s)
Cloudinary  
Image and Video Upload, Storage, Optimization and CDN

Manage web and mobile media assets with the leading cloud service: image and video upload, storage, manipulation, optimization and digital asset management.

Cloudinary  
Image and Video Upload, Storage, Optimization and CDN

Manage web and mobile media assets with the leading cloud service: image and video upload, storage, manipulation, optimization and digital asset management.

Hide attachment content