Open karan-jaryal opened 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"
};
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
@karan-jaryal I'm trying on small steps :)
@kalinchernev plz write your code in typescript you will get rid of this error 😃
Seriously? :)
Yes
Can you shed a light of how does it help and/or how come it's not mentioned in the docs?
Any update on this issue ? Solution to this please
Will this be fixed?
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")
Hi, I am getting error "regeneratorRuntime is not defined" while running your example.