I started using this library for user registration, it's quite nice! After following the quick start instructions I had everything working up until the part on creating new users with mutations. I believe I followed all the instructions to the letter but I was getting this error:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/promise/promise.py", line 489, in _resolve_from_executor
executor(resolve, reject)
File "/usr/local/lib/python3.8/site-packages/promise/promise.py", line 756, in executor
return resolve(f(*args, **kwargs))
File "/usr/local/lib/python3.8/site-packages/graphql/execution/middleware.py", line 75, in make_it_promise
return next(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/graphql_auth/bases.py", line 31, in mutate
return cls.resolve_mutation(root, info, **input)
File "/usr/local/lib/python3.8/site-packages/graphql_auth/mixins.py", line 122, in resolve_mutation
payload = cls.login_on_register(
File "/usr/local/lib/python3.8/site-packages/graphql_jwt/decorators.py", line 110, in wrapper
result = f(cls, root, info, **kwargs)
File "/usr/local/lib/python3.8/site-packages/graphql_jwt/decorators.py", line 103, in wrapper
return on_resolve(values)
File "/usr/local/lib/python3.8/site-packages/graphql_jwt/decorators.py", line 74, in on_resolve
payload.token = get_token(user, context)
File "/usr/local/lib/python3.8/site-packages/graphql_jwt/shortcuts.py", line 16, in get_token
return jwt_settings.JWT_ENCODE_HANDLER(payload, context)
File "/usr/local/lib/python3.8/site-packages/graphql_jwt/utils.py", line 37, in jwt_encode
return jwt.encode(
graphql.error.located_error.GraphQLLocatedError: 'str' object has no attribute 'decode'
After looking through the project's requirements file and comparing it to my installed packages, I found that downgrading my PyJWT from 2.0 to 1.7.1 fixes the issue. I think it would be helpful to mention this requirement to use a specific PyJWT version in the installation guide to help others avoid this pitfall.
Expected behavior
No 'decode' issues when creating new users.
Actual behavior
graphql.error.located_error.GraphQLLocatedError: 'str' object has no attribute 'decode' if using PyJWT 2.0
Requirements
Paste the packages you are using, you can get this information from executing pip freeze.
Prerequisites
Description
Mutations are incompatible with PyJWT 2.0
Steps to Reproduce
I started using this library for user registration, it's quite nice! After following the quick start instructions I had everything working up until the part on creating new users with mutations. I believe I followed all the instructions to the letter but I was getting this error:
After looking through the project's requirements file and comparing it to my installed packages, I found that downgrading my PyJWT from 2.0 to 1.7.1 fixes the issue. I think it would be helpful to mention this requirement to use a specific PyJWT version in the installation guide to help others avoid this pitfall.
Expected behavior
No 'decode' issues when creating new users.
Actual behavior
graphql.error.located_error.GraphQLLocatedError: 'str' object has no attribute 'decode' if using PyJWT 2.0
Requirements
Paste the packages you are using, you can get this information from executing
pip freeze
.