lancej
06/12/2017, 10:46 AMimport { request } from 'graphql-request'
const mutation = `{
mutation signinUser($email: String!, $password: String!) {
signinUser(email: { email: $email, password: $password }) {
token,
user {
id
}
}
}
}`
const variables = {
email,
password
}
request('<https://api.graph.cool/simple/v1/xkjdvsdf>', mutation, variables)
.then(data => {
console.log(data)
})
nilan
06/12/2017, 11:08 AMemail
and password
? 🙂nilan
06/12/2017, 11:11 AMEVERYONE
to access the id
of an user?nilan
06/12/2017, 11:11 AMcatch
to print the error: https://github.com/graphcool/graphql-request#error-handlinglancej
06/12/2017, 11:36 AMnilan
06/12/2017, 11:36 AMlancej
06/12/2017, 11:37 AMnilan
06/12/2017, 11:37 AM