我收到此错误“ WSGIRequest”对象没有属性“ request”
PS:片段被截断了。错误来自info.context.request
class Arguments:
input = ForgotPasswordInput()
ok = graphene.Boolean()
message = graphene.String()
@staticmethod
def mutate(root, info, input=None):
try:
user = User.objects.get(email=input.get('email'))
current_site = get_current_site(info.context.request)```
答案 0 :(得分:1)
info.context
本身就是 request 对象。所以应该是
current_site = get_current_site(info.context)
^^^^^^^^^^^^^^