Hi all! How would one go about making
/blog/[slug] work with a Hygraph database? (I’m a newbie using NextJS, Headless API, and SSG/[[…catchall]])
I’ve set up my slugs and blog content in Hygraph, but I’m stuck a little unsure of how to get plasmic to dynamically display pages based on the slug.
• The Plasmic CMS example in the documentation added a
slug param to
getStaticPaths and a
getProductsSlugs() asyncs function to the catchall file (link to catchall in plasmic-cms-nextjs).
• Based on this Hygraph blog tutorial, it looks like I need to
a. Create a
.env.local file with my Hygraph “endpoint” URL
getStaticPaths, add my Hygraph “slug” GraphQL query directly there, and modify the returned
slug param? ← this part I’m the most unsure about