Skip to main content

environmentEvents

Subscribe to events within a specific environment via WebSocket.

Receives updates and deletions for the environment itself, lifecycle events for its default resources (set/removed), and creation, update, and deletion events for every instance, connection, and alarm in that environment (including alarm firing-state transitions). Environment creation events are delivered via projectEvents (the environment must exist before you can subscribe to it). Requires project:view on the environment's project. If you lose access, events arrive as null.

graphql
subscription {
environmentEvents(organizationId: "my-org", environmentId: "my-project-prod") {
... on Event { action timestamp }
... on EnvironmentEvent {
environment { id name }
}
... on EnvironmentDefaultEvent {
environmentDefault { id resource { id name } }
}
... on InstanceEvent {
instance { id name status }
}
... on ConnectionEvent {
connection { id fromField toField }
}
... on AlarmEvent {
alarm { id displayName currentState { status message } }
}
}
}
graphql
environmentEvents(
organizationId: ID!
environmentId: ID!
): EnvironmentEventsPayload

Arguments​

environmentEvents.organizationId ● ID! non-null scalar {#organization-id}​

Your organization's unique identifier.

environmentEvents.environmentId ● ID! non-null scalar {#environment-id}​

The identifier of the environment to subscribe to.

Type​

EnvironmentEventsPayload union​

Events delivered by the environmentEvents subscription.

Covers the environment itself, its default resources, every instance provisioned into it, every connection wired within it, every alarm attached to those instances, every deployment run against them, and the stash entries of the environment, its instances, and their deployments.