Skip to content
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

How to use async resolver for filter? #23

Open
Baddhizm opened this issue Jul 21, 2020 · 1 comment
Open

How to use async resolver for filter? #23

Baddhizm opened this issue Jul 21, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Baddhizm
Copy link

Baddhizm commented Jul 21, 2020

For example

class UserFilter(FilterSet):
    is_cool = graphene.Boolean()

    @classmethod
    async def is_cool_filter(cls, info, query, value):
        returned_list= await async_func()

        if value:
            filter_ = query.id.in_(returned_list)
        else:
            filter_ = query.id.in_(None)

        return query, filter_
@art1415926535
Copy link
Owner

This cannot be done now. But it will be a nice improvement! 👍

Now I don't have time for this task. Maybe someone can do PR...

@art1415926535 art1415926535 added the enhancement New feature or request label Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants