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

mistake on Mutations page? #182

Open
ofer-pd opened this issue Oct 4, 2024 · 0 comments
Open

mistake on Mutations page? #182

ofer-pd opened this issue Oct 4, 2024 · 0 comments

Comments

@ofer-pd
Copy link

ofer-pd commented Oct 4, 2024

In the first code example under Custom middleware example, in the first function:

def lowercase_middleware(resolver, obj, info, **args):
    if iscoroutinefunction(resolver):
        return lowercase_middleware_async(resolver, obj, info, **args)

    value = resolver(obj, info, **args)
    if is_awaitable(value):
        return lowercase_awaitable(value)

    return lowercase_value(await value)

Is the await value on the last line a mistake? You can't say await in a regular function, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant