DEV Community

Discussion on: Putting GraphQL Playground in front of AppSync

Collapse
 
peerhenry profile image
peerhenry

Hi @rebelok ,

It looks like your using Babel to transpile your javascript, which means you need to do a little extra configuration in order to get it to work with Promises.
Check you babel version, if <7.4.0 you will need: npm install --save @babel/polyfill and in as early as possible in your code: require("@babel/polyfill");.
For later versions you can use import "core-js/stable"; and import "regenerator-runtime/runtime";
See this page at babeljs.io for more information.

Collapse
 
rebelok profile image
Andrew Vdovichenko

I didn't add any code except the code from the article ^_^

Thread Thread
 
peerhenry profile image
peerhenry

Hmm, I could not reproduce the issue. Can you tell me what node version you are using and what are the dependencies listed in package.json?

Thread Thread
 
rebelok profile image
Andrew Vdovichenko

Here is the repository: github.com/rebelok/graphql-playground
I've tried on nodes 8, 10, 12 and 14 - the result is the same ^_^

Thread Thread
 
peerhenry profile image
peerhenry • Edited

I was able to fix the issue by installing npm i -S babel-runtime. Apparently it's a peer dependency of @workpop/graphql-proxy, meaning it doesn't get installed alongside of it. (The only reason I didn't run into this earlier is because node was able to resolve it from an underlying folder on my end.) I will update the article, thanks for bringing it to my attention. Let me know if this fixes the issue for you as well.