Skip to main content

Federation Service API Reference

Base URL

http://localhost:8020/api

GraphQL Endpoint

Federated Query

POST /graphql

Execute federated GraphQL queries that span multiple services.

Example:

query {
users {
id
name
payments {
id
amount
}
}
}

REST API

Health Check

GET /health

Response:

{
"status": "healthy",
"database": "connected",
"services": {
"gateway": "healthy",
"payment": "healthy"
}
}

List Schemas

GET /schemas

Get all discovered GraphQL schemas.

Response:

{
"schemas": [
{
"service": "gateway",
"url": "http://gateway:8000/api/graphql",
"schema": "...",
"lastUpdated": "2024-01-15T10:00:00Z"
}
]
}

Introspect Service

POST /schemas/introspect
Content-Type: application/json

{
"serviceUrl": "http://gateway:8000/api/graphql"
}

Manually trigger schema introspection for a service.

Refresh Schemas

POST /schemas/refresh

Refresh all cached schemas from their services.

Error Responses

{
"error": {
"code": "ERROR_CODE",
"message": "Error message",
"details": {}
}
}