johhansantana
11/06/2017, 3:38 PMconst GraphQLClient = require('graphql-request').GraphQLClient
module.exports = function (event) {
const client = new GraphQLClient('<https://api.graph.cool/simple/v1/appId>');
function getItem() {
return client.request(`
{
User(id:"randomUserId") {
id
email
shoppingCart {
products
}
}
}
`)
}
const items = getItem()
console.log('ITEMS: ', items)
return {
data: {
products: items
}
}
}
this is a custom resolver but the query there returns nothing, what am I doing wrongjohhansantana
11/06/2017, 4:10 PM