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

Class Query

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

Source from the content-addressed store, hash-verified

33
34
35class Query(graphene.ObjectType):
36 me = graphene.Field(UserType)
37 users = graphene.List(UserType)
38
39 def resolve_users(self, info):
40 return get_user_model().objects.all()
41
42 def resolve_me(self, info):
43 user = info.context.user
44 if user.is_anonymous:
45 raise Exception('Not logged in!')
46
47 return user

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected