GraphQL API
GraphQL is the transport Kloudfuse uses for its programmatic query APIs. It is not a language for searching logs — you do not write GraphQL to express a log search. Instead, a GraphQL request is the envelope: it names the API operation to call, carries a FuseQL or event query as a string argument, and declares which response fields to return.
When Kloudfuse uses GraphQL
GraphQL is involved whenever you call Kloudfuse query APIs from code or the command line:
-
Logs API — operations such as
getLogMetricsResultWithKfuseQl(aggregated log metrics) andgetLogsWithFuseQlStream(raw log retrieval with cursor pagination) take a FuseQL query string as an argument. See Logs API Reference for the full operation list. -
Events API — event queries are embedded in the GraphQL request arguments the same way. See API for Events.
-
Interactive exploration — the in-browser explorer at the same endpoint provides schema-aware typeaheads and validation for building these requests. See Interactive explorer.
Interfaces in the Kloudfuse UI use these APIs internally; you only work with GraphQL directly when automating queries.
| GraphQL is not one of the supported query languages for searching telemetry. The query language inside the request is FuseQL (or an event query); GraphQL only wraps it. |
Endpoint and authentication
All GraphQL operations are served from a single endpoint on your Kloudfuse instance:
POST https://<kloudfuse-hostname>/query
Authenticate with a Service Account Bearer token in the Authorization header. Streaming operations (GraphQL subscriptions, such as getLogsWithFuseQlStream) run over a WebSocket connection to the same path.
Anatomy of a request
A request is a JSON payload with a single query field containing the GraphQL document. The GraphQL document selects the operation, passes the FuseQL query and time range as arguments, and lists the response fields to return:
curl -s -X POST "https://<kloudfuse-hostname>/query" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"query": "{ getLogMetricsResultWithKfuseQl(query: \"level=\\\"error\\\" | count by (source)\", startTs: \"2026-07-04T14:00:00Z\", endTs: \"2026-07-04T15:00:00Z\") { ColumnHeaders AggrValues GroupKeys TableResult } }"}'
Reading the GraphQL document itself:
-
A query document starts and ends with {} (curly brackets).
-
Arguments are of the form
argument: value; the FuseQL query travels as an escaped string in thequeryargument. -
The field list after the arguments —
ColumnHeaders,AggrValues,GroupKeys,TableResult— controls exactly what the response contains; omit fields you do not need. -
Lines that start with a # (hash) are comments.
Because the FuseQL string is nested inside a JSON string inside a GraphQL string, quotes inside the FuseQL query need double escaping (\\\") when written inline; client libraries and GraphQL variables avoid this.
Interactive explorer
Opening the /query endpoint in a browser serves an interactive GraphQL explorer for writing, validating, and testing requests before automating them. As you type, it offers typeaheads aware of the current GraphQL schema, live syntax highlighting, and inline validation errors, and it documents every operation and its argument types.