graphql-python / graphql-python/graphql-relay-py

Why are nodes optional?

オープン
#19 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
144
フォーク
41
PR マージ指標
30日以内にマージされた PR はありません

説明

I was trying to dig through this to figure it out, and I apologize if there's a good reason for this.

It seems to me that a paginated connection (e.g. `DjangoConnectionField` or `DjangoFilterConnectionField`) always has edges and nodes. What's the use case for these being nullable?

The reason I bring this up is because, when using TypeScript with the generated schema, it results in lengthy checks like this:

```tsx
{edges.map(edge => (


{edge &&
edge.node &&
edge.node.id (
...
```

As far as I can tell this is set up here:
https://github.com/graphql-python/graphql-relay-py/blob/master/graphql_relay/connection/connection.py#L44

Could there be `required` on edges/nodes? At least as an option it'd be a breaking change. Right now I'm not sure how to override this.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。