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:
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