GraphQL API
The GraphQL API is a powerful way to access your data. GraphQL is a query language that enables your applications to ask for specific fields on a filtered set of objects. It returns only the data that is requested with minimal overhead. For example, the query below returns every machine currently in downtime, with its active alarms, its current execution state, and the open downtime annotation's category and start time.
query ExampleQuery {
machines(where: {annotations: {endAt: {_is_null: true }}}) {
name
currentAlarms {
startAt
nativeCode
label
description
}
currentStates(where: {metricKey: {_eq: "MasterExecution"}}) {
metricKey
value
}
annotations(where: {endAt: {_is_null: true }}) {
annotationType {
name
}
startAt
}
}
}
Schema
The GraphQL schema describes and defines the set of objects, fields, relationships, types, enum values, etc. that a client can access via the API. Calls from the client are validated against the schema. The schema itself is queriable data that can be accessed through the API. This process is called introspection. GraphQL query tools and libraries can introspect the schema and generate documentation, provide code-completion, perform syntax-checks, etc..
Every query and type is listed in the sidebar under Operations and Types. To try queries against live data, open the GraphQL explorer.
Authentication
The GraphQL API is read-only. Every request carries a bearer token in the Authorization header: an API key for scripts and integrations (see Authentication with API keys), or the credential mm-react-tools supplies inside an app.
Limits
To keep the service fast for every company, requests are rate-limited and queries are bounded in depth and node count. The current values are on Usage Limits.