GraphQL1) enables flexible, precise data queries.
GraphQL2) is a query language for APIs and a runtime for executing these queries. Unlike REST3), clients can request exactly the data they need.
POST /api/v1/dsn/{dbName}/graphql
Content-Type: application/json
{ "query": "{ customers { id name country } }" }
{ "query": "{ customers(first: 10, filter: \"Country eq 'DE'\") { id name } }" }
GET /api/v1/dsn/demo/graphql/schema
Returns the GraphQL schema in SDL4) format.
| Aspect | REST | GraphQL |
|---|---|---|
| Endpoints | Many (per resource) | One |
| Over-fetching | Common | Never |
| Under-fetching | Common (N+1) | Never |
| Type safety | Optional | Built-in |
| Documentation | External (OpenAPI5)) | Integrated (Introspection) |