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

TypeError: GraphQLView() received an invalid keyword 'subscriptions_enabled'. as_view only accepts arguments that are already attributes of the class. #644

Closed
thclark opened this issue Oct 18, 2024 · 3 comments · Fixed by #645
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@thclark
Copy link
Contributor

thclark commented Oct 18, 2024

Describe the Bug

When using subscriptions in a view as according to the docs here, you update your urls.py to look like:

urlpatterns = [
  ...
    path(
        'graphql/',
        AsyncGraphQLView.as_view(
            schema=schema,
            graphiql=settings.DEBUG,
            subscriptions_enabled=True,
        ),
    ),
    ...
]

However, this causes an error during testing:

TypeError: AsyncGraphQLView() received an invalid keyword 'subscriptions_enabled'. as_view only accepts arguments that are already attributes of the class.

The same error occurs using GraphQLView() rather than AsyncGraphQLView().

System Information

# from my pyproject.toml
strawberry-graphql = {version = "^0.246.2", extras = ["debug-server"]}
strawberry-graphql-django = "^0.49.0"

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@thclark thclark added the bug Something isn't working label Oct 18, 2024
@bellini666
Copy link
Member

bellini666 commented Oct 18, 2024

Hey @thclark ,

That keyword got removed from strawberry on https://github.com/strawberry-graphql/strawberry/releases/tag/0.245.0. We probably need to update the docs here as well, thanks for pointing that out.

Let me tag this as `documentation``

(if by any chance you want to try to send a PR for this sooner, feel free! otherwise I'll probably fix it by the weekend)

@bellini666 bellini666 added documentation Improvements or additions to documentation good first issue Good for newcomers and removed bug Something isn't working labels Oct 18, 2024
@thclark
Copy link
Contributor Author

thclark commented Oct 20, 2024

Thanks @bellini666 - love it when it's just a docs tweak :)

Copy link
Member

Thank you @bellini666 for contributing to close this issue! ⭐

The rewards from this issue, totaling $40, has been shared with you.

What now?

  1. Create a Polar account
  2. See incoming rewards & setup Stripe to receive them
  3. Get payouts as backers finalize their payments

If you already have a Polar account setup, you don't need to do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
3 participants