Hello WordPress community,
I'm working on a project where I need to create a custom post type using Advanced Custom Fields (ACF) and query it via WPGraphQL to integrate with a Headless Next.js build. Specifically, I want to achieve the following:
Single Instance Custom Post Type: I want to create a custom post type called "Homepage" that allows only one instance to exist. This single instance will represent the homepage of the website.
Limited Module Options: Within this "Homepage" custom post type, I'd like to restrict the editor to adding only a predefined set of modules (e.g., hero section, featured posts, gallery, etc.). The goal is to provide a structured and controlled editing experience.
Integration with WPGraphQL: Once the "Homepage" custom post type is set up with its limited module options, I intend to query this
data using WPGraphQL to retrieve and render it within a Headless
Next.js frontend.
I've already registered the custom post type using ACF, but I'm unsure how to enforce the single instance constraint and restrict the module options for the editor. Additionally, I'd appreciate any guidance on how to effectively query this custom post type data via WPGraphQL for seamless integration with Next.js.
Any advice, code examples, or resources related to achieving these goals would be greatly appreciated!
Thank you in advance for your assistance.
Best regards,
J