mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
docs: improve live query docs
[DOCS-1547]: https://hasurahq.atlassian.net/browse/DOCS-1547?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10489 GitOrigin-RevId: 9f0e70c25a38aabc1fd71e4abf55aa3ee242ab73
This commit is contained in:
parent
d39f30c38c
commit
9b914baaea
@ -36,7 +36,7 @@ have multiple subscriptions running at the same time they must be in separate qu
|
||||
|
||||
### Live queries
|
||||
|
||||
A live query subscription will return the latest result of the query being made and not necessarily all the individual
|
||||
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 [here](/subscriptions/postgres/livequery/index.mdx).
|
||||
|
@ -14,13 +14,15 @@ slug: index
|
||||
|
||||
## 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.
|
||||
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, such as with a
|
||||
[streaming subscription](/subscriptions/postgres/streaming/index.mdx).
|
||||
|
||||
By default, updates are delivered to clients every **1 sec**.
|
||||
|
||||
See more details on
|
||||
[subscriptions execution](/subscriptions/postgres/livequery/execution.mdx).
|
||||
A live query is a query that is continuously monitored for changes in the database and automatically updates the query
|
||||
result whenever the underlying data changes. Live queries are a PostgreSQL-specific implementation that allow real-time
|
||||
updates to clients without the need for manual polling or refreshing.
|
||||
|
||||
## Convert a query to a subscription
|
||||
|
||||
@ -29,8 +31,8 @@ You can turn any query into a subscription by simply replacing `query` with `sub
|
||||
:::info Single subscription in each query caveat
|
||||
|
||||
Hasura follows the [GraphQL spec](https://graphql.github.io/graphql-spec/June2018/#sec-Single-root-field) 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.
|
||||
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.
|
||||
|
||||
:::
|
||||
|
||||
|
@ -15,8 +15,11 @@ slug: index
|
||||
## Introduction
|
||||
|
||||
A streaming subscription streams the response according to the cursor provided by the user while making the
|
||||
subscription. Streaming subscriptions can be used to subscribe only to the data which has been newly added to the result
|
||||
set.
|
||||
subscription. Streaming subscriptions can be used to subscribe only to the data which has been **newly added to the
|
||||
result set.**
|
||||
|
||||
This is different from a [live query](/subscriptions/postgres/livequery/index.mdx) subscription where only the latest
|
||||
value is returned to the client.
|
||||
|
||||
:::tip Supported from
|
||||
|
||||
@ -35,7 +38,7 @@ Streaming subscriptions work well with other Hasura features like
|
||||
[relationships](/schema/postgres/table-relationships/index.mdx#table-relationships) and also leverage the power of
|
||||
[subscriptions multiplexing](/subscriptions/postgres/livequery/execution.mdx#subscription-multiplexing).
|
||||
|
||||
:::info Confguration details
|
||||
:::info Configuration details
|
||||
|
||||
In the case of streaming subscriptions, the multiplexed batch size can be configured via
|
||||
`HASURA_GRAPHQL_STREAMING_QUERIES_MULTIPLEXED_BATCH_SIZE` and the refetch interval can be configured via
|
||||
|
Loading…
Reference in New Issue
Block a user