Site Content
Overview
BigCommerce’s GraphQL Storefront API allows you to retrieve site content from each storefront channel. Having access to site content makes it easier to build headless storefront applications using BigCommerce’s built-in content, such as theme widgets.
Queries are made in the context of a particular storefront channel. For example, queries for web pages return only web pages for a specific storefront channel. This is useful for Multi-Storefront use cases where you only need site content for a specific channel.
Queries do not support RSS-syndicated content pages as these are deprecated.
Site Content Features
You can use the Site schema to perform the following:
- Query web page content, including HTML pages, contact forms, and blog posts
- Retrieve banner content on home, search, category, and brand pages
- Retrieve rendered widgets built using Page Builder or the Widgets API
- Retrieve web pages and blog posts using the web page URL
Web Pages
Query web page content on specific channels to view the following:
- Page type
- Title of the page (name)
- Is the page visible in the storefront navigation (Yes/No) - Use the isVisibleInNavigation field to filter for only pages that appear in the storefront’s navigation menu. Without the filter, queries will return pages that are hidden from the menu, as these pages are still accessible by URL
- Page SEO
For more information on web pages, see Page Types.
Routes
Routes is another way to retrieve web pages, similar to the Web Pages schema used in the previous section. Routes allows you to retrieve web pages, the main blog index page, and blog posts using the web page URL. The following query retrieves information for the page with the given path URL.
Rendered Regions
Rendered regions allows you to retrieve rendered widgets on plain-text pages. The following query returns the rendered HTML content for all widgets that are placed in Regions on the given page.
Blogs
Queries for blogs retrieve published blog posts and exclude draft blogs. They will return published blogs even if they are hidden from the storefront’s navigation menu, as the main blog index page and published blog posts are still accessible by URL.
Banners
Retrieve banners using the following example query. Queries return only visible banners.
Product Reviews
Create and query product reviews with the GraphQL Storefront API. Before you can use this feature, you must enable product reviews, enable the “only accept product reviews from past customers” setting, and enable reCAPTCHA for your storefront.