graphql-python / graphql-python/graphene-sqlalchemy

Refactor SQLAlchemyConnectionField to use SQLAlchemyObjectType.get_query()

Abierto
#74 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
985
Forks
223
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Right now, `SQLAlchemyConnectionField` uses the `get_query()` implementation in `graphene_sqlalchemy.utils`. The same code is in `SQLAlchemyObjectType`.

https://github.com/graphql-python/graphene-sqlalchemy/blob/1d353f71f4ff256dcf69a7a13a27e4865282b044/graphene_sqlalchemy/fields.py#L18-L20

https://github.com/graphql-python/graphene-sqlalchemy/blob/1d353f71f4ff256dcf69a7a13a27e4865282b044/graphene_sqlalchemy/types.py#L146-L149

This means that if someone wants to update the query for an `SQLAlchemyObjectType`, e.g. to implement permissions restrictions, they have to subclass not only `SQLAlchemyObjectType` but also `SQLAlchemyConnectionField`.

I suggest refactoring `SQLAlchemyConnectionField` to re-use the `get_query()` implementation of the `SQLAlchemyObjectType` it wraps. I'm willing to look into creating a PR if there is interest.

Guía de contribución

Abrir la guía de contribución

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.