kriasoft / kriasoft/react-firebase-starter

Schema downloading on setup

Open
#259 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
4.5k
Forks
752
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in setup.js at the schema-download logic shown in the issue, then review the graphql-cli graphql get-schema command and its expected configuration. Replace the current approach so setup can request the schema from a standard GraphQL server, and verify that schema downloading works through the usual GraphQL API.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, javascript
Domain
api, build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.