Users management - dfernandezm/moneycol GitHub Wiki

GraphQL Queries and Mutations

Using the playground, the full query or mutation can be input in the main box

If a token needs to be provided (any protected query or mutation after login):

More info on using the GraphQL Playground here

Creation of users

Requires login (see below)

mutation signUp($userInput: SignUpUserInput!) {
  signUpWithEmail(userInput: $userInput) {
    userId
    username
    email
    firstName
    lastName  	
  }
}
---
{
 "userInput": {
  "username": "testUser1",
  "email": "[email protected]",
  "password": "testPass",
  "repeatedPassword": "testPass",
  "firstName": "dafe",
  "lastName": "Dafe52"
}
}

Update profile

Requires login (see below)

mutation updateUserProfile($input: UpdateUserProfileInput!) {
  updateUserProfile(updateUserProfileInput: $input) {
    userId,
    username,
    email,
    firstName,
    lastName
  }
}

----

{
  "input": {
    "username": "dafe52",
    "firstName": "Alph",
    "lastName": "Argsh",
    "userId": "13M99QaYnCZ2AKkwDo4Y"
  }
}

Verify email

mutation verifyEmail($input: VerifyEmailInput!) {
  verifyEmail(verifyEmailInput: $input) {
    comebackUrl
    result
  }
}
---
{
  "input": {
    "email": "[email protected]",
    "code":"ccSwSFB8rtfDuHGmYLSKUpZp4ThKSyRSwc1gFOpVxVQAAAFyeQrbVA",
    "lang": "en",
    "comebackUrl": "http%3A%2F%2Flocalhost%3A4000%2Flogin%3Femail%3DmoneycolTestUser1%40mailinator.com"
  }
}

Login

mutation login($email: String!, $password: String!) {
  loginWithEmail(email: $email, password: $password) {
    token
    email
    userId
  }
}

---

{
  "email": "[email protected]",
  "password": "testPassword1"
}