Enterprise Feature
The Graph API is an enterprise feature. Please contact your account manager to enable it.
Overview
The Graph API provides a GraphQL interface for querying your Baseline data. It supports complex queries with filtering, sorting, pagination, aggregations, and relationships between tables — all in a single request.
The API is introspectable, meaning you can query the schema itself to discover available tables, fields, and relationships. Use any standard GraphQL client or tool (e.g., Postman, Insomnia, GraphQL Playground) to explore the schema.
Endpoint
POST /api/graph
Authentication
Requires API key authentication (same as all other Baseline API endpoints).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | A GraphQL query string |
variables | object | No | Variables referenced in the query |
operationName | string | No | The name of the operation to execute (if the query contains multiple operations) |
Introspection
The Graph API supports standard GraphQL introspection. You can query the schema to discover all available types, fields, and relationships:
{
"query": "{ __schema { types { name fields { name type { name kind ofType { name } } } } } }"
}
Or query a specific table's fields:
{
"query": "{ __type(name: \"loans\") { fields { name type { name kind } } } }"
}
Query Features
The Graph API supports the following query features:
- Filtering:
where: { field: { _eq: value } }with operators_eq,_neq,_gt,_gte,_lt,_lte,_in,_like,_ilike,_is_null - Sorting:
order_by: { field: asc }ordesc - Pagination:
limitandoffset - Aggregations:
loans_aggregate { aggregate { count sum { amount } avg { rate } } } - Relationships: Traverse related tables directly in your query (e.g.,
loans { borrows { person { name } } })
Error Responses
| Status | Description |
|---|---|
400 | Missing GraphQL query in request body |
403 | Authentication failed or insufficient permissions |
GraphQL-level errors are returned in the standard errors array within the JSON response body.
