LLM Skills
~/catalogue/backend//graphql-storefront
Backendsource GitHub

Token Storefront

/graphql-storefront

L'API GraphQL Storefront permet d'interroger les données storefront pour le commerce headless, les thèmes Stencil et les expériences d'achat personnalisées. Elle fournit un accès en lecture seule aux données catalogue, p

qdhenryqdhenry
1.3k
1 mars 2026
// contenu du skill

<overview>

The GraphQL Storefront API enables querying storefront data for headless commerce, Stencil themes, and custom shopping experiences. It provides read-only access to catalog data, carts, checkout, and customer information. For mutations and admin operations, use REST APIs.

</overview>

<endpoint>

POST https://{store_domain}/graphql
Authorization: Bearer {storefront_token}
Content-Type: application/json

Replace {store_domain} with your storefront URL (e.g., store.mybigcommerce.com or custom domain).

</endpoint>

<authentication>

<token_types>

Storefront Token:

  • Anonymous shopper queries
  • Public catalog data
  • Create via REST API

Customer Impersonation Token:

  • Customer-specific data (wishlists, account info)
  • Server-to-server requests
  • More secure, limited exposure

</token_types>

<creating_tokens>

bash
# Storefront Token
POST /v3/storefront/api-token
{
  "channel_id": 1,
  "expires_at": 1893456000,
  "allowed_cors_origins": ["https://your-site.com"]
}

# Customer Impersonation Token
POST /v3/storefront/api-token-customer-impersonation
{
  "channel_id": 1,
  "expires_at": 1893456000
}

</creating_tokens>

<best_practices>

  • Rotate tokens regularly
  • Use short expiration for client-side tokens
  • Customer impersonation tokens for server-side only
  • Respect Principle of Least Privilege

</best_practices>

</authentication>

<common_queries>

<get_products>

graphql
query GetProducts($first: Int!) {
  site {
    products(first: $first) {
      edges {
        node {
          entityId
          name
          sku
          path
          prices {
            price {
              value
              currencyCode
            }
            salePrice {
              value
            }
          }
          defaultImage {
            url(width: 500)
          }
          variants {
            edges {
              node {
                entityId
                sku
                inventory {
                  isInStock
                  aggregated {
                    availableToSell
                  }
                }
              }
            }
          }
        }
      }
      pageInfo {
        hasNextPage
        endCursor
      }
    }
  }
}

</get_products>

<get_category>

graphql
query GetCategory($path: String!) {
  site {
    route(path: $path) {
      node {
        ... on Category {
          entityId
          name
          description
          products {
            edges {
              node {
                entityId
                name
                prices {
                  price {
                    value
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

</get_category>

<search_products>

graphql
query SearchProducts($searchTerm: String!) {
  site {
    search {
      searchProducts(filters: {searchTerm: $searchTerm}) {
        products {
          edges {
            node {
              entityId
              name
              path
            }
          }
        }
      }
    }
  }
}

</search_products>

<get_customer>

Requires customer impersonation token or logged-in customer context:

graphql
query GetCustomer {
  customer {
    entityId
    email
    firstName
    lastName
    company
    customerGroupId
    addresses {
      edges {
        node {
          entityId
          firstName
          lastName
          address1
          city
          stateOrProvince
          postalCode
          countryCode
        }
      }
    }
  }
}

</get_customer>

</common_queries>

<cart_operations>

<create_cart>

graphql
mutation CreateCart($input: CreateCartInput!) {
  cart {
    createCart(input: $input) {
      cart {
        entityId
        lineItems {
          physicalItems {
            entityId
            productEntityId
            variantEntityId
            name
            quantity
            extendedSalePrice {
              value
            }
          }
        }
      }
    }
  }
}

Variables:

json
{
  "input": {
    "lineItems": [
      {
        "productEntityId": 123,
        "variantEntityId": 456,
        "quantity": 2
      }
    ]
  }
}

</create_cart>

<addtocart>

graphql
mutation AddToCart($input: AddCartLineItemsInput!) {
  cart {
    addCartLineItems(input: $input) {
      cart {
        entityId
        lineItems {
          physicalItems {
            entityId
            name
            quantity
          }
        }
      }
    }
  }
}

</addtocart>

<get_cart>

graphql
query GetCart($entityId: String!) {
  site {
    cart(entityId: $entityId) {
      entityId
      currencyCode
      isTaxIncluded
      baseAmount {
        value
      }
      discountedAmount {
        value
      }
      amount {
        value
      }
      lineItems {
        physicalItems {
          entityId
          name
          quantity
          extendedSalePrice {
            value
          }
        }
        digita
// source originale publique
qdhenry/Claude-Command-Suite
/.claude/skills/bigcommerce-api/references/graphql-storefront.md
Licence : Licence non indiquée. Consultez le dépôt avant toute réutilisation.
Projet indépendant, non affilié à Anthropic. Ce skill reste la propriété de son auteur original.
// installer ce skill
Collez cette commande dans votre terminal à la racine de votre projet :
mkdir -p .claude/commands && curl -o ".claude/commands/graphql-storefront.md" "https://raw.githubusercontent.com/qdhenry/Claude-Command-Suite/main/.claude/skills/bigcommerce-api/references/graphql-storefront.md"
Ensuite dans Claude Code, tapez /graphql-storefront pour l'activer.
open_in_newVoir la source originale
// sauvegarder
Sauvegarde disponible après connexion.
loginSe connecter pour sauvegarder
// informations
Créateurqdhenry
Étoiles 1.3k
CatégorieBackend
Mis à jour1 mars 2026
Format.md
AccèsGratuit
// similaires

Skills Backend

Voir toutarrow_forward