Documentation Improvement by adding an example and description for initialEvent for custom subscriptions
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 38/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- graphql, javascript
- 領域
- api, documentation
調査の方向性
まず、カスタムサブスクリプションのドキュメントと、既存の @pgSubscription および currentUserTopicFromContext の例を見つけます。initialEvent について、その関数シグネチャと、示されている接続確立の例を含めてドキュメント化します。読者がそれをどのように提供するか、また返されるオブジェクトが何を制御するかを理解できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Over the last few days I've been trying to create a custom subscription that sends the data directly after connecting. However, there is no example in the documentation of an initial event or any evidence that there is an interface for it. The default behavior of an custom subscription is that it only fetches the previous data and the new data (on insert) after an event was been triggered on the database side.
I only got the information about the initialEvent from the discord server:
- By providing the
initialEventargument to@pgSubscription(...)intypeDefsyou can pass to it the function which you want to be executed on connection establishment the same way ascurrentUserTopicFromContextfrom the docs to topic:
currentUserUpdated: UserSubscriptionPayload @pgSubscription(topic: ${embed(
currentUserTopicFromContext,
)})
with initialEvent:
currentUserUpdated: UserSubscriptionPayload @pgSubscription(topic: ${embed(
currentUserTopicFromContext,
)}, initialEvent: ${embed(
onInitialEvent, //the function that you want to be executed
)})
The function that you want to be executed in initialEvent has the same structure as currentUserTopicFromContext:
const onInitialEvent = async (_args, context, _resolveInfo) => {
// do something
return {}; // return an object
}
Now because returning an empty object was the solution for my problem (get already existing data on connection establishment), I didn't dig any deeper on what arguments I can give to the object to control the behavior and what operations can be done in the initialEvent function. This can be added additionally to the documentation.
Adding description for initialEvent and examples for it to the documentation to make it clear that something like that exists would help allot.
- 主要言語
- SCSS
- スター
- 27
- フォーク
- 124
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphile/graphile.github.io のほかの issue
-
website: Update details on homepage and sponsor page再び着手できるかも @jemgillam が 1119 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンquick
graphile/graphile.github.io#399 · コメント 4 件 · 担当者 1 名 ·
-
sponsor page: New wording around Grafast needed!再び着手できるかも @jemgillam が 1149 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
graphile/graphile.github.io#393 · リアクション 1 件 · 担当者 1 名 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 38/100
graphile/graphile.github.io#341 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
graphile/graphile.github.io#280 · コメント 2 件 · リアクション 5 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
graphile/graphile.github.io#273 · コメント 2 件 ·
graphile/graphile.github.io の issue をすべて見る
似ている issue
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
dsx-ai-factory/health-validation#368 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Tripstack-Corp/spyc#1352 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vllm-project/vllm#70030 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
help wanted small extra
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信