PedroBern / django-graphql-auth

Django registration and authentication with GraphQL.
https://django-graphql-auth.readthedocs.io/en/latest/
MIT License
326 stars 105 forks source link

wrapper() missing 1 required positional argument: 'info' #122

Closed Scanood closed 2 years ago

Scanood commented 3 years ago

Hello, I'm learning programming. When I use from graphql_jwt.decorators import login_required,everything is fine.

But when I use from graphql_auth.decorators import login_required

there is a mistake wrapper() missing 1 required positional argument: 'info'

This is my code:

import graphene
from .types import Products
from .types import ProductModel
from graphql_jwt.decorators import login_required, permission_required

#from graphql_auth.decorators import login_required

class ProductQuery(graphene.ObjectType):
    products = graphene.List(Products)

    @login_required
    @permission_required('products.view_product')
    def resolve_products(root, info, **kwargs):
        return ProductModel.objects.all()

requirements: aniso8601==7.0.0 appdirs==1.4.4 asgiref==3.3.4 black==21.6b0 click==8.0.1 colorama==0.4.4 Django==3.2.4 django-cors-headers==3.7.0 django-filter==2.4.0 django-graphql-auth==0.3.16 django-graphql-jwt==0.3.0 graphene==2.1.8 graphene-django==2.15.0 graphql-core==2.3.2 graphql-relay==2.0.1 importlib-metadata==4.6.0 mypy-extensions==0.4.3 pathspec==0.8.1 promise==2.3 PyJWT==1.7.1 pytz==2021.1 regex==2021.7.1 Rx==1.6.1 singledispatch==3.6.2 six==1.16.0 sqlparse==0.4.1 text-unidecode==1.3 toml==0.10.2 typed-ast==1.4.3 typing-extensions==3.10.0.0 zipp==3.5.0

python:3.7.3

windows10

I would appreciate it if you could give me some help.

andrewtmendoza commented 2 years ago

Same error

Genza999 commented 2 years ago

Hi, may I ask why you are using graphql_auth and not graphql_jwt to import login_required.