For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • Overview
  • Learning Plans
    • Developer Foundations
    • Composable Developer
    • Stencil Developer
    • B2B Developer
  • Courses
        • Course Overview and Prerequisites
        • What is GraphQL?
        • What is the GraphQL Storefront API?
        • Lab - See it in Action!
        • BigCommerce GraphQL Tools
      • Conclusion
    • Learning Changelog
Dev Portal
LogoLogo
On this page
  • Accessing the Storefront API Playground
  • Accessing the Storefront API Playground Manually
  • How to Use the Storefront API Playground
  • View Documentation and Schema
  • GraphQL Storefront API Reference
  • Example: Building a Query
CoursesGraphQL Storefront APIModule 1: Overview

BigCommerce GraphQL Tools

Was this page helpful?
Previous

Lab - See it in Action!

Next

Authentication

Built with

Plan: Developer Foundations

Lesson 5 of 28 · 30 min

Storefront API Playground

The Storefront API Playground is a testing tool that can be accessed from the control panel of a Stencil store. BigCommerce’s GraphQL API uses the Storefront API Playground to let you run requests in the browser.

The Storefront API Playground is our implementation of GraphiQL, which is a fairly common tool. Developers who have used GraphQL before should immediately be able to make the connection to their previous experience.

Accessing the Storefront API Playground

To access the Storefront API Playground and documentation:

  1. Log in to a BigCommerce store
  2. Navigate to Settings > API > Storefront API Playground

GraphQL Playground

If the Storefront API Playground link is not visible, this may be because your store is not using a Stencil theme. Apply a Stencil theme to access the Storefront API Playground.

Accessing the Storefront API Playground Manually

Accessing the Storefront API Playground manually (i.e., from gql-playground.bigcommerce.com) doesn’t automatically connect to your store to the playground like the control panel flow does. Instead, this link is connected to the Buy Button Sample Store and can still be used to test out simple queries. You can still use this link to connect to your store, but you will need to provide your own Storefront API token, which is covered in the next module.

How to Use the Storefront API Playground

To use the playground, input queries on the left side and then click the play button. Query results will be displayed on the right side:

Query Example

View Documentation and Schema

To explore the storefront GraphQL schema, click on the Docs tab on the left side of the Storefront API Playground.

View Docs and Schema

GraphQL Storefront API Reference

The dynamic API reference available in the BigCommerce docs is an exhaustive and cross-linked list of the GraphQL Storefront API schema, including all queries, mutations, and types. This reference can be used to drill down easily from a top-level query or mutation to all fields and sub-fields below it.

  • GraphQL Storefront API Reference

Example: Building a Query

Using the Docs tab and the API reference, you can determine the structure of any query. For example, the structure of the query for categoryTree would be:

query{
site{
categoryTree{
entityId
name
description
productCount
hasChildren
}
}
}

Use the GraphQL Playground to run the query and see what information you receive.

GraphQL Playground Demo

Pro Tip!

Use the command option + space bar (Mac OS) or control + space bar (Window OS) when writing a query in the GraphQL Playground to view possible sub-selections.