react-firebase-starter icon indicating copy to clipboard operation
react-firebase-starter copied to clipboard

Schema downloading on setup

Open quolpr opened this issue 8 years ago • 0 comments

The code from setup.js, that downloads schema:

//
// Inject "babel-plugin-transform-export-extensions"
// -----------------------------------------------------------------------------
file = path.resolve('./node_modules/babel-preset-react-app/index.js');
text = fs.readFileSync(file, 'utf8');

if (!text.includes('babel-plugin-transform-export-extensions')) {
  if (text.includes('const plugins = [')) {
    text = text.replace(
      'const plugins = [',
      "const plugins = [\n  require.resolve('babel-plugin-transform-export-extensions'),"); // prettier-ignore
    fs.writeFileSync(file, text, 'utf8');
  } else {
    throw new Error(`Failed to inject babel-plugin-transform-export-extensions in ${file}.`); // prettier-ignore
  }
}

will not be working with the usual GraphQL API. Can we replace it with https://github.com/graphcool/graphql-cli (graphql get-schema) ? It requests schema directly from GrapgQL server.

quolpr avatar Oct 06 '17 07:10 quolpr