Skip to main content
The GraphQL API supports real-time subscriptions for content updates via WebSocket connections.

Subscription Schema

Available Subscriptions

contentUpdated

Watch for updates to published content

previewUpdated

Watch for updates to draft previews

WebSocket Client Setup

Subscriptions are served from wss://ws-api.metabind.ai, which is a different host from the one queries and mutations use. api.metabind.ai is an HTTP API and cannot accept a WebSocket upgrade, so pointing a subscription client at it will never connect. Note the ?protocol=graphql-transport-ws query parameter. graphql-ws clients normally negotiate the subprotocol through the Sec-WebSocket-Protocol header, but API Gateway does not forward that header to the backend — the query parameter is what selects the GraphQL protocol, and the connection is treated as a plain realtime socket without it. Use wss://ws-api-dev.metabind.ai for the dev environment.

Using graphql-ws

For Preview Subscriptions

Use previewToken instead of x-api-key:

Handling Large Payloads

AWS WebSocket has a 100KB payload limit. When data exceeds this limit:
  1. The content or component field will be null
  2. The resolvedRef field is always included
  3. Fetch the full data separately using the ID
  4. Use the resolvedRef to fetch package data