GraphQL API Overview#

The Afosto GraphQL API provides a single endpoint for all operations. Use queries to fetch data and mutations to create or modify resources.

Endpoint#

POST https://afosto.app/graphql

All requests are POST requests with a JSON body containing your query and any variables.

Request format#

{
  "query": "query { ... }",
  "variables": { "key": "value" }
}

What's available#

NameTypeRequiredDescription
Queries
Section
OptionalFetch products, orders, customers, and more
Mutations
Section
OptionalCreate, update, and delete resources
Types & Scalars
Section
OptionalAll available types, enums, and custom scalars
Pagination
Section
OptionalHow to paginate through large result sets
Error Handling
Section
OptionalUnderstanding and handling API errors

Example query#

query GetProducts($first: Int) {
  products(first: $first) {
    edges {
      node {
        id
        name
        sku
      }
    }
  }
}
Query Runnerhttps://afosto.app/graphql

No query loaded

Click play on any code block in the docs to load a query here.