React Native Sign In with GraphQL
Steps:
- Use the Getting Started guide to launch your first app.
- Create a sign in form using Formik with email and password, make sure to valid the fields.
- Add Apollo Client to the app, check out the guide Integrating with React Native.
https://recruitment-signin-endpoint.now.sh
- Submit your form values to the
signInQuery
query signInQuery($email: String! $password: String!) {
signIn(email: $email password: $password) {
id
firstName
lastName
auth {
token
}
}
}
- Sign In using these credentials π΅οΈββοΈ
{
"email": "[email protected]",
"password": "agent007"
}
- Retrieve and store
auth.token
π
{
"data": {
"signIn": {
"id": "5e81132169df12c084d23703",
"firstName": "Holger",
"lastName": "Ballweg",
"auth": {
"token": "XXXXXXXXXXXXXXXXXXXXXXX"
}
}
}
}
- Demo it to us! π (May the demo Gods be with you)