yahya
06/02/2017, 11:33 AMsebastien
06/02/2017, 4:36 PMstripe.customers.create({
email: user.email,
description: user.name,
source: cardDetails.cardToken
}, (err, customer) => {
if (err) {
console.log(err)
send(res, 400, { error: `Stripe customer with card details ${cardDetailsId} could not be created for user ${userId}` })
} else {
// then update user with obtained Stripe customer id
const updateUser = `mutation {
updateUser(id: "${userId}", stripeId: "${customer.id}") {
id
}
}`
<http://request.post|request.post>({
url: endpoint,
headers: {
'Authorization' : graphcoolToken,
'content-type': 'application/json',
},
body: JSON.stringify({query: updateUser}),
}).on('error', (e) => {
send(res, 400, { error: `User ${userId} could not be updated` })
}).on('response', (response) => {
send(res, 200, { message: `User ${userId} was successfully registered at Stripe` })
})
}
}
)
I set the endpoint
to my Graphcool simple API endpoint and graphcoolToken
to a permanent auth token that I generated. I also have the update permission on users fully open for now.sebastien
06/02/2017, 4:53 PMjony
06/02/2017, 4:56 PMjony
06/02/2017, 4:56 PMjony
06/02/2017, 4:58 PMjony
06/02/2017, 5:02 PMgiedriusr
06/02/2017, 5:05 PMgraphcool init --schema <http://graphqlbin.com/instagram.graphql>
In the past it worked, but now I get:
â ‹ Creating project Dewcrane Ogre...:heavy_multiplication_x: Error: No .schema file found or specified
giedriusr
06/02/2017, 5:05 PMgiedriusr
06/02/2017, 5:07 PMyahya
06/02/2017, 5:42 PMyahya
06/02/2017, 5:42 PMyahya
06/02/2017, 5:42 PMyahya
06/02/2017, 5:43 PMquery { allTimelogs { id }}
it says i don't have permissionyahya
06/02/2017, 5:43 PMniwat
06/02/2017, 8:13 PMswttt
06/02/2017, 9:05 PMlastmjs
06/02/2017, 9:16 PMlastmjs
06/02/2017, 9:17 PMlastmjs
06/02/2017, 9:18 PMswttt
06/02/2017, 9:19 PMswttt
06/02/2017, 9:19 PMswttt
06/02/2017, 9:19 PMlastmjs
06/02/2017, 9:21 PMlastmjs
06/02/2017, 9:21 PMlastmjs
06/02/2017, 9:21 PMlastmjs
06/02/2017, 9:22 PMswttt
06/02/2017, 9:22 PMed
06/02/2017, 9:26 PMdbkooper
06/02/2017, 10:10 PM