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

Why are nodes optional?

Abierto
#19 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
144
Forks
41
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.