storefrontEditorHeartbeat
Requires permission storefront:storefront:read.
An open storefront editor checks in (every 20 seconds, and when its unsaved state changes). Answers the other editors open now and when the draft was last saved; records nothing durable.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation StorefrontEditorHeartbeat($input: StorefrontEditorHeartbeatInput!) {
storefrontEditorHeartbeat(input: $input) {
draftUpdatedAt
editors {
name
dirty
lastSeenAt
pageId
self
sessionId
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation StorefrontEditorHeartbeat($input: StorefrontEditorHeartbeatInput!) {\n storefrontEditorHeartbeat(input: $input) {\n draftUpdatedAt\n editors {\n name\n dirty\n lastSeenAt\n pageId\n self\n sessionId\n }\n }\n}",
"variables": {
"input": {
"dirty": true,
"sessionId": "string"
}
}
}
EOF
Variables:
{
"input": {
"dirty": true,
"sessionId": "string"
}
}
Response:
{
"data": {
"storefrontEditorHeartbeat": {
"draftUpdatedAt": "2025-01-15T00:00:00Z",
"editors": [
{
"name": "string",
"dirty": true,
"lastSeenAt": "2025-01-15T00:00:00Z",
"pageId": "string",
"self": true,
"sessionId": "string"
}
]
}
}
}
storefrontEditorHeartbeat(
input: StorefrontEditorHeartbeatInput!
): StorefrontEditorHeartbeat!
Arguments
storefrontEditorHeartbeat.input ● StorefrontEditorHeartbeatInput! non-null input
This editor window: its own id, whether it has unsaved changes, and the page it shows.
Type
StorefrontEditorHeartbeat object
The other open editors of this storefront, and when its draft was last saved.