Message of the day:
Anything GraphQL and SilverStripe related.
likes GraphQL. The same API, but not the hassle of REST or SOAP
I think ill likely just create a service to take an id, method and size eg /image/1234/maxSize/300/300
@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 🙂
Manage web and mobile media assets with the leading cloud service: image and video upload, storage, manipulation, optimization and digital asset management.
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
Is there a smarter way?
Should I just return 3 sizes via Graphql? small, med and large?
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?
On the list of todos 🙂
But yeah, generally speaking, if you're doing decoupled, you wouldn't be colocating your uploaded assets with your CMS
@gened thanks, how do you trigger your builds for the pages? Once a day? manually?
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
do you cache json data or how is it structured?
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
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.
yeah that was part of it. Thanks I have it kind of working now