-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graphene-sqlalchemy-filter not working in nested graphQL query. #35
Comments
Try this code: class GroupFilter(FilterSet):
class Meta:
model = GroupModel
fields = {
# some fields
}
class TaskFilter(FilterSet):
class Meta:
model = TaskModel
fields = {
# some fields
}
class CustomFilterableConnectionField(FilterableConnectionField):
filters = {
TaskModel: TaskFilter(),
GroupModel: GroupFilter()
}
class TaskNode(SQLAlchemyObjectType):
class Meta:
model = TaskModel
interfaces = (Node,)
connection_field_factory = CustomFilterableConnectionField.factory
class GroupNode(SQLAlchemyObjectType):
class Meta:
model = GroupModel
interfaces = (Node,)
connection_field_factory = CustomFilterableConnectionField.factory
class TaskConnection(Connection):
class Meta:
node = TaskNode
class GroupConnection:
class Meta:
node = GroupNode
class Query(ObjectType):
all_tasks = CustomFilterableConnectionField(TaskConnection)
all_groups = CustomFilterableConnectionField(GroupConnection) |
Hi!
Filters are not working for the below query:
It seems like nested filters are not working. |
Hi @bhavnish07! I have reproduced your example here https://github.com/art1415926535/graphene-sqlalchemy-filter/tree/issue_35/examples/groups_and_tasks. Everything seems to work fine. |
Nice effort @art1415926535 , thank you in the name of all interested in this module! |
I am having issues in implementing graphene-sqlalchemy-filter in nested graphQL query. It is working as expected with normal graphQL query but when implemented in nested query the filter seems to not work.
I have two models:
#The code for filtering :
`
in schema:
Queries
Task query is working alright but filterGroup and allFilterGroup query have no filtering affect.
The text was updated successfully, but these errors were encountered: