Developers
GraphQL
#Overview
The current GraphQL endpoint accepts a deliberately limited query subset.
#Currently supported subset
The /api/graphql endpoint is protected like the rest of the API. It recognizes zones, files, stats, and nodes queries and scopes every result to the authenticated organization.
The current parser is not a general GraphQL server: introspection, mutations, complex fragments, and arbitrary fields are not guaranteed. An unsupported query returns an errors array; files are limited to 50 in this version.
#Send a query
Put query text in the JSON
queryproperty.Add
variablesonly when the query uses them.Check for
errorseven with a JSON HTTP response.Treat missing fields as incompatibility, not an assumed null.
#Available queries
This interface is a read-only subset without introspection or general mutations.
#zones
All zones in the organization.
Fields: id name domain isActive isVerified status region publicFilesReady
query {
zones {
id
name
domain
isActive
isVerified
status
region
publicFilesReady
}
}
#files
The first 50 visible files.
Fields: id uuid name size mimeType url publicPath
query {
files {
id
uuid
name
size
mimeType
url
publicPath
}
}
#stats
Aggregates for the last 30 days.
Fields: totalRequests totalBandwidth zonesCount filesCount
query {
stats {
totalRequests
totalBandwidth
zonesCount
filesCount
}
}
#nodes
Organization nodes, without IP addresses.
Fields: id hostname region status
query {
nodes {
id
hostname
region
status
}
}