MyGit

v2.7.0

hasura/graphql-engine

版本发布时间: 2022-05-25 23:46:50

hasura/graphql-engine最新发布版本:v2.44.0(2024-10-08 18:36:54)

Changelog

Streaming subscriptions

Streaming subscriptions can be used to subscribe only to the data which has been changed in the query. The streaming is done on the basis of a cursor, which is chosen by the user. See docs.

Request payload:

subscription GetUserLatestMessages ($user_id: uuid!) {
  messages_stream (
    cursor: {
      initial_value: {id: 0}, 
      ordering: ASC
    }, 
    batch_size: 1, 
    where: {user_id: {_eq: $user_id}} 
  ) {
    id
    message
  }
}

The above subscription streams the messages of the user corresponding to the user_id in batches of 1 message per batch.

Suppose there are two messages to be streamed, then the server will send two responses as following:

Response 1:

{
  "data": [
    {
      "id": 1,
      "message": "How are you!"
    }
  ]
}

Response 2:

{
  "data": [
    {
      "id": 5,
      "message": "I am fine"
    }
  ]
}

Bug fixes and improvements

相关地址:原始地址 下载(tar) 下载(zip)

1、 cli-hasura-darwin-amd64 75.14MB

2、 cli-hasura-darwin-arm64 75.19MB

3、 cli-hasura-linux-amd64 23.45MB

4、 cli-hasura-linux-arm64 22.02MB

5、 cli-hasura-windows-amd64.exe 69.01MB

查看:2022-05-25发行的版本