現在、ドキュメントページから django-graphqljwt の基本的な例を実行しています。https://django-graphql-jwt.domake.io/en/latest/quickstart.html
import graphene
import graphql_jwt
class Mutation(graphene.ObjectType):
token_auth = graphql_jwt.ObtainJSONWebToken.Field()
verify_token = graphql_jwt.Verify.Field()
refresh_token = graphql_jwt.Refresh.Field()
schema = graphene.Schema(mutation=Mutation)
ただし、tokenAuth
ミューテーションを実行すると、インターフェースで以下のエラーがスローされGraphiQL
ます。間違った資格情報を入力すると、以下の代わりに " "がスローされることに注意してください。Please enter valid credentials
{
"errors": [
{
"message": "'str' object has no attribute 'decode'",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"tokenAuth"
]
}
],
"data": {
"tokenAuth": null
}
}