You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to create the following custom class mutation , in order to create users if they are not aready exists. To do that I need to pas arguments from the forest end like username, password.....
So I tried this .
class SocialAuth(graphql_social_auth.SocialAuthJWT):
# class Arguments:
# id = graphene.Int(required=False)
user = graphene.Field(schema.Users)
@classmethod
def resolve(cls, root, info, social, **kwargs):
try:
user = models.ExtendUser.objects.get(email=social.uid)
return cls(user=user)
except:
# TODO use profileObj. get username email and all these and add them kwargs
user = models.ExtendUser.objects.create(
email=social.uid, username=social.uid[0:6], password="AAssppmm11", imageUrl="https://miro.medium.com/max/1200/1*mk1-6aYaf_Bes1E3Imhc0A.jpeg")
return cls(user=user)
But adding class Arguments: make the arguments provider and accessToken disappear.
an other problem is the token return null in the costum class mutation, while is working very well in the social_auth = graphql_social_auth.SocialAuthJWT.Field()
The text was updated successfully, but these errors were encountered:
I think this is because the way Python works - the new class Arguments replaces the original one and doesnt inherit from it. You need to do it manually. In this case you would define it like this: class Arguments(graphql_social_auth.SocialAuthJWT.Arguments)
Maybe you could use the super builtin instead of the whole class name to shorten it and make more universal. Hope that helps.
I need to create the following custom class mutation , in order to create users if they are not aready exists. To do that I need to pas arguments from the forest end like username, password.....
So I tried this .
But adding
class Arguments:
make the argumentsprovider
andaccessToken
disappear.an other problem is the token return null in the costum class mutation, while is working very well in the
social_auth = graphql_social_auth.SocialAuthJWT.Field()
The text was updated successfully, but these errors were encountered: