【发布时间】:2020-11-15 08:42:22
【问题描述】:
我想更改 verifyToken 突变的有效负载。因此,我不想返回电子邮件,而是想返回 id 或整个对象
schema.py
import graphql_jwt
class Query(AccountsQuery, ObjectType):
# This class will inherit from multiple Queries
# as we begin to add more apps to our project
pass
class Mutation( AccountsMutation, ObjectType):
# This class will inherit from multiple Mutations
# as we begin to add more apps to our project
token_auth = graphql_jwt.ObtainJSONWebToken.Field()
verify_token = graphql_jwt.Verify.Field()
refresh_token = graphql_jwt.Refresh.Field()
pass
schema = Schema(query=Query, mutation=Mutation)
但我不知道如何实现 - 如果这是正确的方法
有什么想法可以做到吗?
【问题讨论】:
标签: django graphql jwt token graphene-python