graphql-python / graphql-python/graphene-sqlalchemy

Refactor SQLAlchemyConnectionField to use SQLAlchemyObjectType.get_query()

Aberta
#74 1 comentário 1 reação 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
985
Forks
223
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.