MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / CreateUser

Class CreateUser

hackernews/backend-python/users/schema.py:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11
12class CreateUser(graphene.Mutation):
13 user = graphene.Field(UserType)
14
15 class Arguments:
16 username = graphene.String(required=True)
17 password = graphene.String(required=True)
18 email = graphene.String(required=True)
19
20 def mutate(self, info, username, password, email):
21 user = get_user_model()(
22 username=username,
23 email=email,
24 )
25 user.set_password(password)
26 user.save()
27
28 return CreateUser(user=user)
29
30
31class Mutation(graphene.ObjectType):

Callers 1

mutateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected