alonp99 / graphql-rest-wrapper

Wraps RestAPI with GraphQL
MIT License
33 stars 8 forks source link

regeneratorRuntime is not defined #3

Open karan-jaryal opened 7 years ago

karan-jaryal commented 7 years ago

Hi, I am getting error "regeneratorRuntime is not defined" while running your example.

kalinchernev commented 7 years ago

Same issue, here's code:

var express = require('express');
var W = require('graphql-rest-wrapper');
var { API, NEWS } = require('./constants');

var app = express();
var host = process.env.IP || 'localhost';
var port = process.env.PORT || '8000';

const wrapper = new W(`${API}/${NEWS}`, {
  name: 'COPE API',
  generateSchema: true,
  saveSchema: true,
  graphiql: true
});

app.use('/graphql', wrapper.expressMiddleware());

app.listen(port, () => {
  console.log(`Server: https://${host}:${port}`);
});

Where the API is:

module.exports = {
  API: "https://webgate.acceptance.ec.europa.eu/fpfis/ilayer/beta",
  NEWS: "docs/types/news"
};
karan-jaryal commented 7 years ago

Hi kalinchernev, Thanks ,but it's for one news api i think if i have more than 10 or 20 api than how to create one wrapper for it

kalinchernev commented 7 years ago

@karan-jaryal I'm trying on small steps :)

karan-jaryal commented 7 years ago

@kalinchernev plz write your code in typescript you will get rid of this error 😃

kalinchernev commented 7 years ago

Seriously? :)

karan-jaryal commented 7 years ago

Yes

kalinchernev commented 7 years ago

Can you shed a light of how does it help and/or how come it's not mentioned in the docs?

valerianpereira commented 7 years ago

Any update on this issue ? Solution to this please

muety commented 7 years ago

Will this be fixed?

pascalc commented 7 years ago

You can fix this by adding babel-polyfill:

InstallIng:

yarn add babel-polyfill

Requiring in your app's entrypoint, e.g. src/index.js

require("babel-polyfill")