trove.poc_api.users.schema module

class trove.poc_api.users.schema.Mutation(*args, **kwargs)[source]

Bases: graphene.types.objecttype.ObjectType

signup = <graphene.types.field.Field object>
class trove.poc_api.users.schema.Query(*args, **kwargs)[source]

Bases: graphene.types.objecttype.ObjectType

me = <graphene.types.field.Field object>
resolve_me(info)[source]
resolve_users(info)[source]
users = <graphene.types.structures.List object>
class trove.poc_api.users.schema.SignUp(*args, **kwargs)[source]

Bases: graphene.types.mutation.Mutation

Returning a fresh JWT Token as part of the sign-up process was NOT originally envisioned in the example provided in the tutorial for graphene-django. However, a token was expected to be returned from the SIGNUP_MUTATION in the Apollo-Client tutorial. A solution was found after reading through the (obtuse) code for the graphql_jwt and graphene libraries.

We needed to make sure that the request for the JWT was being routed through the graphql_jwt.middleware.JSONWebTokenMiddleware so that an an authenticated Django User object was getting added into the context object.

class Arguments[source]

Bases: object

email = <graphene.types.scalars.String object>
firstName = <graphene.types.scalars.String object>
lastName = <graphene.types.scalars.String object>
password = <graphene.types.scalars.String object>
username = <graphene.types.scalars.String object>
classmethod mutate(root, info, firstName, lastName, username, password, email)[source]
token = <graphene.types.scalars.String object>
user = <graphene.types.field.Field object>
class trove.poc_api.users.schema.UserType(*args, **kwargs)[source]

Bases: graphene_django.types.DjangoObjectType