art1415926535 / graphene-sqlalchemy-filter

Filters for Graphene SQLAlchemy integration
https://pypi.org/project/graphene-sqlalchemy-filter/
MIT License
118 stars 34 forks source link

Filters without manual filters= option #7

Closed docelic closed 4 years ago

docelic commented 5 years ago

Hey Artem,

In issue #6 we also discussed that your syntax for creating FilterableConnectionFields requires argument filters=:

class ModelAFilter(FilterSet):
  # ...
class ModelA(ObjectType):
  Meta:
    model = ModelAModel
    # ...

class RootQuery(graphene.ObjectType):
  something = FilterableConnectionField('ModelA', filters=ModelAFilter()) # <--- 

Could you somehow make it so that the ModelAFilter is specified directly inside ModelA or it's meta class, so that one does not have to manually pass the filters= option when creating a field?

Thanks!

art1415926535 commented 5 years ago

Hi. Last week I worked on ways to solve #6. It's almost ready. I have to write tests. Soon I will announce new features. One of the side effects of my solution closes this issue.

art1415926535 commented 4 years ago

New version released. New documentation section here.