sondahub

sondahub / Public GraphQL API

Public GraphQL APIs to test against

Seven schemas over 78,076 related records — e-commerce, IoT, banking, social, helpdesk, flights and a company directory — with introspection, nested relations both ways, real filters and typed mutations. Free, no key.

The endpoints

POST {"query", "variables", "operationName"} as JSON, or GET with ?query=. No key; CORS open.

SchemaEndpointSDL
Store (9 types)https://api.sondahub.com/v1/store/graphqlsdl
Fleet (5 types)https://api.sondahub.com/v1/fleet/graphqlsdl
Bank (6 types)https://api.sondahub.com/v1/bank/graphqlsdl
Social (5 types)https://api.sondahub.com/v1/social/graphqlsdl
Helpdesk (5 types)https://api.sondahub.com/v1/helpdesk/graphqlsdl
Flights (4 types)https://api.sondahub.com/v1/flights/graphqlsdl
Identity (3 types)https://api.sondahub.com/v1/identity/graphqlsdl

Nested relations in one query

The Social API is the deeply related one: a user, their posts, each post's comments and each comment's author, in one round trip.

{
  user(id: 1) {
    username
    display_name
    posts(limit: 2, sort: "-published_at") {
      body
      likes_count
      comments(limit: 2) {
        body
        author { username }
      }
    }
  }
}
Run it
curl https://api.sondahub.com/v1/social/graphql -H "Content-Type: application/json" \
  -d '{"query": "{ user(id: 1) { username display_name posts(limit: 2, sort: \"-published_at\") { body likes_count comments(limit: 2) { body author { username } } } } }"}'

Filters, sorting, paging, search

Every collection is a list query taking filter (field names with the REST operator suffixes: _ne _gt _gte _lt _lte _like _in _null), sort, page, limit, q and ids, answering { total, data } — plus a by-id query named after the singular (product(id: 1)). A relation to many records (a user's posts) is a plain list that takes the same arguments.

{
  products(filter: { price_lt: 20, in_stock: true }, sort: "price", limit: 5) {
    total
    data { id name price category { name } }
  }
}
Run it
curl https://api.sondahub.com/v1/store/graphql -H "Content-Type: application/json" \
  -d '{"query": "{ products(filter: { price_lt: 20, in_stock: true }, sort: \"price\", limit: 5) { total data { id name price category { name } } } }"}'

Mutations

Each collection has createX, updateX, replaceX and deleteX, with typed inputs. They run the same rules as REST — a review recomputes the product's rating in the answer — and keep to the session token like every write.

mutation {
  createReview(input: { product_id: 1, customer_id: 1, rating: 5, title: "Great", body: "Works every day." }) {
    id
    rating
    product { rating review_count }
  }
}
Run it
curl https://api.sondahub.com/v1/store/graphql -H "Content-Type: application/json" \
  -d '{"query": "mutation { createReview(input: { product_id: 1, customer_id: 1, rating: 5, title: \"Great\", body: \"Works every day.\" }) { id rating product { rating review_count } } }"}'

Questions

Is there a public GraphQL API with introspection?

Seven of them, one per API, at https://api.sondahub.com/v1/{api}/graphql. Introspection answers the standard query, so GraphQL IDEs, Sonda's GraphQL mode and code generators load the schema; ?sdl returns the schema as SDL text.

Are subscriptions supported?

No — subscriptions need a long-lived connection per client, and the same events already flow over the WebSocket and SSE streams of each API.

Can I use GET instead of POST?

Yes: GET …/graphql?query=…, with &variables= as JSON when the query takes any.

What happens on a mutation?

It is validated against the schema and the collection's rules, run, and answered with the record as a real server would return it. The HTTP answer carries an X-Sondahub-Session token with the change; send it back and later queries — GraphQL or REST — see it. The response's extensions carry the note.