Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !12120

simplify GraphQL files loading

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge github/fork/mrduguo/main into main Mar 03, 2022
  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 2

Created by: mrduguo

use simpler graphql-tag/loader other than graphql.macro

Document updated as well. You may see how it was looks before and after: Screenshot_2022-03-03_at_22_53_51

The implementation has been published as graphql-tag-react-scripts@5.0.2

Manual test for none GraphQL project

npx create-react-app none-gql-project --scripts-version graphql-tag-react-scripts@5.0.2
cd none-gql-project
npm run build
# expected build success without error

Manual test for Apollo based GraphQL project

npx create-react-app apollo-gql-project --scripts-version graphql-tag-react-scripts@5.0.2
cd apollo-gql-project
npm install --save @apollo/client
cat <<EOT > src/index.js
import query from './foo.graphql';
console.log(query)
EOT

cat <<EOT > src/foo.graphql
query {
  hello {
    world
  }
}
EOT

npm run build
grep hello build/static/js/main.*.js

# expect contain the hello keyword
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/mrduguo/main