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.
You can use the Site schema to perform the following:
Query web page content on specific channels to view the following:
For more information on web pages, see Page Types.
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 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.
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.
Retrieve banners using the following example query. Queries return only visible banners.
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.