Skip to content

Instantly share code, notes, and snippets.

@du5rte
Created April 3, 2020 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save du5rte/e1bffdecc2c01950247aeaa8db6ee469 to your computer and use it in GitHub Desktop.
Save du5rte/e1bffdecc2c01950247aeaa8db6ee469 to your computer and use it in GitHub Desktop.
GraphQL Sign In Challenge πŸ’«

Sign In Challenge

React Native Sign In with GraphQL

Challenge

Steps:

  1. Use the Getting Started guide to launch your first app.
  2. Create a sign in form using Formik with email and password, make sure to valid the fields.
  3. Add Apollo Client to the app, check out the guide Integrating with React Native.
https://recruitment-signin-endpoint.now.sh
  1. Submit your form values to the signInQuery
query signInQuery($email: String! $password: String!) {
  signIn(email: $email password: $password) {
    id
    firstName
    lastName
    auth {
      token
    }
  }
}
  1. Sign In using these credentials πŸ•΅οΈβ€β™€οΈ
{
	"email": "holgerballweg@mail.com",
	"password": "agent007"
}
  1. Retrieve and store auth.token πŸ”
{
  "data": {
    "signIn": {
      "id": "5e81132169df12c084d23703",
      "firstName": "Holger",
      "lastName": "Ballweg",
      "auth": {
        "token": "XXXXXXXXXXXXXXXXXXXXXXX"
      }
    }
  }
}
  1. Demo it to us! πŸŽ‰ (May the demo Gods be with you)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment