Skip to content
Guides

GraphQL

Compose store, product, collection, seller, and review reads through POST /graphql.

Last updated:

GraphQL is an additional way to consume selected Storefront API reads. REST retains the complete contract and remains the interface for every write operation.

GraphQL and REST coexist

Use GraphQL when a screen needs to combine several reads or select a small set of fields. Use REST for carts, checkout, customers, geography, tracking, analytics, and every operation that changes data.

Quick start

Send a document through POST and resolve the store with x-Store-Domain:

Terminal
curl --request POST "https://storefront.ecomiq.pe/graphql" \
  --header "Content-Type: application/json" \
  --header "x-Store-Domain: my-store" \
  --data-binary '{
    "query": "query Store { store { id name currency language } }"
  }'
Response
{
  "data": {
    "store": {
      "id": "7204558912004325301",
      "name": "My store",
      "currency": "PEN",
      "language": "en"
    }
  }
}

IDs are opaque strings. Store and send them back without interpreting their format.

Available queries

These are all reads currently published on the root Query:

Choose GraphQL or REST

NeedRecommended interface
Combine store, seller, and products in one responseGraphQL
Request only a subset of a resource's fieldsGraphQL
Search products with filters equivalent to the REST catalogGraphQL or REST
Create or update a cart, checkout, or customerREST
Read geography, tracking, or analyticsREST
Consume an OpenAPI contract or Postman collectionREST

The current schema exposes Query and does not expose Mutation. The REST reference documents the rest of Storefront API.

Explore by task

On this page