lkbr
08/04/2017, 1:51 PM"returnValue":{"code":500,"error":"Error resolving named webtask","details":"Error resolving named webtask: node module \"request@2.81.0@2.81.0\" is not currently available"}}
The function is based off the cloudinary images example here: https://github.com/graphcool-examples/functions/blob/master/cloudinary-images/cloudinary.jsnotrab
08/04/2017, 2:24 PMThor Even Tutturen
08/04/2017, 2:38 PMandersonlf
08/04/2017, 2:52 PMandre
08/04/2017, 3:06 PMtype GravatarPayload {
url: String!
}
extend type Query {
gravatar(email: String!, size:Int): GravatarPayload
}
The function:
const crypto = require('crypto');
module.exports = function (event) {
const email = event.data.email;
const size = event.data.size || 200;
const hash = crypto.createHash('md5').update(email).digest("hex");
return {
data: {
url: `<https://www.gravatar.com/avatar/${hash}?s=${size}>`
}
};
}
When I execute the query with the following arguments:
query {
gravatar(email:"a-valid-email-address", size:500) {
url
}
}
The result looks like:
{
"data": {
"gravatar": {
"url": "<https://www.gravatar.com/avatar/5ee5cd89f7ed6895e80400156211fdbb?s=Some(500)>"
}
}
}
I’m wondering where the Some(500)
comes from. Any ideas?cball
08/04/2017, 3:16 PMmutation {
signupEmailUser(email:"<mailto:chris@echobind.com|chris@echobind.com>", password:"test1234") {
id
}
}
And here’s the error:
{
"data": {
"signupEmailUser": null
},
"errors": [
{
"locations": [
{
"line": 2,
"column": 3
}
],
"functionError": "Error: Unknown argument 'email' on field 'User' of type 'Query'. (line 3, column 12):\n User(email: \"<mailto:chris@echobind.com|chris@echobind.com>\") {\n ^: {\"response\":{\"data\":null,\"errors\":[{\"message\":\"Unknown argument 'email' on field 'User' of type 'Query'. (line 3, column 12):\\n User(email: \\\"<mailto:chris@echobind.com|chris@echobind.com>\\\") {\\n ^\",\"locations\":[{\"line\":3,\"column\":12}]}],\"status\":200},\"request\":{\"query\":\"\\n query {\\n User(email: \\\"<mailto:chris@echobind.com|chris@echobind.com>\\\") {\\n id\\n }\\n }\"}}",
"path": [
"signupEmailUser"
],
"code": 5001,
"message": "function execution error: Error: Unknown argument 'email' on field 'User' of type 'Query'. (line 3, column 12):\n User(email: \"<mailto:chris@echobind.com|chris@echobind.com>\") {\n ^: {\"response\":{\"data\":null,\"errors\":[{\"message\":\"Unknown argument 'email' on field 'User' of type 'Query'. (line 3, column 12):\\n User(email: \\\"<mailto:chris@echobind.com|chris@echobind.com>\\\") {\\n ^\",\"locations\":[{\"line\":3,\"column\":12}]}],\"status\":200},\"request\":{\"query\":\"\\n query {\\n User(email: \\\"<mailto:chris@echobind.com|chris@echobind.com>\\\") {\\n id\\n }\\n }\"}}",
"requestId": "simple:cj5y0djgn4hrm01472znstweu"
}
]
}
peterp
08/04/2017, 3:40 PMpeterp
08/04/2017, 3:55 PMpeterp
08/04/2017, 3:55 PMpeterp
08/04/2017, 4:25 PMuser
08/04/2017, 4:43 PMhttps://prisma.slack.com/files/U5GF08HKM/F6HMC0KHN/demo-delete-models.gif▾
user
08/04/2017, 5:02 PMhttps://prisma.slack.com/files/U5GF08HKM/F6HMC0KHN/demo-delete-models.gif▾
graphcool
toolchain in the future. However we don't want to rush this as we're planning to change the CLI quite a bit going forward.
I think the easiest would be if you'd release it as a stand alone tool (or even better as a graphql-cli
plugin) and we'll merge it in at some point in the future?spences10
08/04/2017, 5:06 PM.graphql
file on the graphcool
CLI?
Just had a thought!
If I have a bootstrap which other people will be using and I have my graphcool project defined via project.graphcool
how does a new user set up their own instance of the project?ckelley
08/04/2017, 5:12 PMspences10
08/04/2017, 5:17 PMgraphcool init --schema schema.graphql
spences10
08/04/2017, 5:17 PMspences10
08/04/2017, 5:30 PMspences10
08/04/2017, 5:33 PMgraphcool init --schema schema.graphql
didn't workspences10
08/04/2017, 5:33 PMpeterp
08/04/2017, 5:40 PMcj
08/04/2017, 5:57 PMmwickett
08/04/2017, 6:08 PMnilan
08/04/2017, 6:47 PMnilan
08/04/2017, 6:47 PMzach
08/04/2017, 6:48 PMherdani
08/04/2017, 6:53 PMjcarva
08/04/2017, 8:38 PMjcarva
08/04/2017, 8:41 PMpcooney10
08/04/2017, 9:07 PMleandros
08/04/2017, 9:22 PM