Skip to main content
Version: v2.x

Postgres: Live Query Subscriptions

Introduction

A Live query subscription will return the latest result of the query being made and not necessarily all the individual events leading up to the result.

By default, updates are delivered to clients every 1 sec.

See more details on subscriptions execution.

Convert a query to a subscription

You can turn any query into a subscription by simply replacing query with subscription as the operation type.

Single subscription in each query caveat

Hasura follows the GraphQL spec which allows for only one root field in a subscription. You also cannot execute multiple separate subscriptions in one query. To have multiple subscriptions running at the same time they must be in separate queries.

Use cases