trinile / graphql-mongodb-backend-example

Basic backend boilerplate using graphql mongodb express webpack
1 stars 0 forks source link

Gulp generating schema error #3

Open trinile opened 7 years ago

trinile commented 7 years ago

Receiving Reference error: regeneratorRuntime not defined. Adding below code doesn't seem to work.

    .pipe(babel({
      presets: [ 'es2015', 'stage-0'],
      plugins: ['transform-object-rest-spread', ['transform-runtime', {
      'polyfill': false,
      'regenerator': true
    }]],
    }))
});

Async functions and generators cannot be used in the script for generating schema. Issue is babel-polyfill needs to be required. Alternatives? babel-transform-runtime. Current fix: using npm script to watch schema files and rebuild upon changes. Gulp file is not currently useful at the moment.