Closed ego closed 2 years ago
Hey there, for filtering in graphene-sqlalchemy<3.0
, take a look at graphene-sqlalchemy-filter
or look in the closed and open issues, there are plenty of suggestions, you can pick the one that fits your needs best.
One way you can get the query of an SQLAlchemyConnectionField
is this:
class Query(graphene.ObjectType):
all_departments = SQLAlchemyConnectionField(Department.connection, sort=None)
def resolve_all_departments(parent, info, sort=None, **kwargs):
query = SQLALchemyConnectionField.get_query(Department._meta.model, info, sort)
#apply additional modificaitons to your query
return query.all()
Thanks for your time and reply.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics referencing this issue.
Hi there!
Maybe someone asked this question, sorry. But how to do post processing or override relationship result with
SQLAlchemyConnectionField
?https://github.com/graphql-python/graphene-sqlalchemy/blob/master/examples/flask_sqlalchemy/schema.py#L36