mikedklein
09/24/2017, 3:16 PMmikedklein
09/24/2017, 4:02 PMhttps.get
method to make the request but it just isn't working
const https = require('https');
module.exports = function (event) {
const GEOCODE_API = '<https://maps.googleapis.com/maps/api/geocode/json?>';
const API_KEY = 'key=<MYGOOGLEAPIKEY>';
const STREET = event.data.street;
const CITY = event.data.city;
const STATE = event.data.state;
const ZIP = event.data.zip;
const ADDRESS_KEY = 'address=' + STREET + '%20' + CITY + '%2C%20' + STATE + '%20' + ZIP;
const URL = GEOCODE_API + API_KEY + '&' + ADDRESS_KEY;
https.get(URL, (res) => {
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);
res.on('data', (d) => {
console.log(d);
});
}).on('error', (e) => {
console.error(e);
});
}
mikedklein
09/24/2017, 4:33 PMRippo
09/24/2017, 5:38 PMStephen
09/24/2017, 6:43 PMStephen
09/24/2017, 6:44 PMcoolboyjules
09/24/2017, 8:53 PMcoolboyjules
09/24/2017, 8:55 PMlancej
09/24/2017, 11:00 PMUnhandled rejection TypeError: Cannot read property 'props' of undefined
lancej
09/24/2017, 11:04 PMjoshjoe
09/25/2017, 1:20 AMjoshjoe
09/25/2017, 2:20 AMjoshjoe
09/25/2017, 2:51 AMstephenhandley
09/25/2017, 2:55 AM$node_id
, $user_id
)
https://github.com/graphcool-examples/graphcool-examples/blob/master/webshop/permissions/User.update-delete.graphqlAmanda
09/25/2017, 6:02 AMClay
09/25/2017, 6:34 AMSchema Extensions
and couldn't find any way to do it in the console. I read the readme, but I still have no idea how to implement this. If anyone can point me to the right direction that would be great. Thanks!vladblindu
09/25/2017, 7:35 AMyunjia
09/25/2017, 11:07 AM<http://2d0b5iw4041.execute-api.eu-west-1.amazonaws.com/prod/create/|2d0b5iw4041.execute-api.eu-west-1.amazonaws.com/prod/create/> Failed to load resource: the server responded with a status of 502 ()
edit:1 Fetch API cannot load <https://d0b5iw4041.execute-api.eu-west-1.amazonaws.com/prod/create/>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<https://console.graph.cool>' is therefore not allowed access. The response had HTTP status code 502. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
edit:1 Uncaught (in promise) TypeError: Failed to fetch
Do you have any idea where is the problem? Many thanks.halborg
09/25/2017, 11:16 AMjoar
09/25/2017, 12:50 PMjoar
09/25/2017, 12:53 PMsteved
09/25/2017, 1:00 PMmikedklein
09/25/2017, 1:08 PMjacqui
09/25/2017, 1:19 PMchrishurlburt
09/25/2017, 3:03 PMmiho
09/25/2017, 3:28 PMmiho
09/25/2017, 3:29 PMalan
09/25/2017, 3:34 PMmwickett
09/25/2017, 5:23 PMgraphcool-lib
that includes variables? Does something like request.api(mutation)(variables)
work?mwickett
09/25/2017, 5:26 PM