Skip to content

Commit 6e2c0d7

Browse files
committed
Revert "Add loader for .graphql files (facebook#3909)"
1 parent 88a3de9 commit 6e2c0d7

File tree

11 files changed

+1
-116
lines changed

11 files changed

+1
-116
lines changed

packages/react-scripts/config/jest/graphqlTransform.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/react-scripts/config/webpack.config.dev.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,6 @@ module.exports = {
352352
'sass-loader'
353353
),
354354
},
355-
// The GraphQL loader preprocesses GraphQL queries in .graphql files.
356-
{
357-
test: /\.(graphql)$/,
358-
loader: 'graphql-tag/loader',
359-
},
360355
// "file" loader makes sure those assets get served by WebpackDevServer.
361356
// When you `import` an asset, you get its (virtual) filename.
362357
// In production, they would get copied to the `build` folder.

packages/react-scripts/config/webpack.config.prod.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,6 @@ module.exports = {
391391
'sass-loader'
392392
),
393393
},
394-
// The GraphQL loader preprocesses GraphQL queries in .graphql files.
395-
{
396-
test: /\.(graphql)$/,
397-
loader: 'graphql-tag/loader',
398-
},
399394
// "file" loader makes sure assets end up in the `build` folder.
400395
// When you `import` an asset, you get its filename.
401396
// This loader doesn't use a "test" so it will catch all modules

packages/react-scripts/fixtures/kitchensink/integration/webpack.test.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,6 @@ describe('Integration', () => {
8181
doc.defaultView.close();
8282
});
8383

84-
it('graphql files inclusion', async () => {
85-
const doc = await initDOM('graphql-inclusion');
86-
const children = doc.getElementById('graphql-inclusion').children;
87-
88-
// .graphql
89-
expect(children[0].textContent.replace(/\s/g, '')).toBe(
90-
'{"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","variableDefinitions":[],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"test"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"test"},"value":{"kind":"StringValue","value":"test","block":false}}],"directives":[],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"test"},"arguments":[],"directives":[]}]}}]}}],"loc":{"start":0,"end":40,"source":{"body":"{\\ntest(test:\\"test\\"){\\ntest\\n}\\n}\\n","name":"GraphQLrequest","locationOffset":{"line":1,"column":1}}}}'
91-
);
92-
doc.defaultView.close();
93-
});
94-
9584
it('image inclusion', async () => {
9685
const doc = await initDOM('image-inclusion');
9786

packages/react-scripts/fixtures/kitchensink/src/App.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,6 @@ class App extends Component {
134134
this.setFeature(f.default)
135135
);
136136
break;
137-
case 'graphql-inclusion':
138-
import('./features/webpack/GraphQLInclusion').then(f =>
139-
this.setFeature(f.default)
140-
);
141-
break;
142137
case 'image-inclusion':
143138
import('./features/webpack/ImageInclusion').then(f =>
144139
this.setFeature(f.default)

packages/react-scripts/fixtures/kitchensink/src/features/webpack/GraphQLInclusion.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/react-scripts/fixtures/kitchensink/src/features/webpack/GraphQLInclusion.test.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/react-scripts/fixtures/kitchensink/src/features/webpack/assets/graphql.graphql

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/react-scripts/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
"eslint-plugin-react": "7.11.1",
4747
"file-loader": "1.1.11",
4848
"fs-extra": "7.0.0",
49-
"graphql": "0.13.2",
50-
"graphql-tag": "2.9.2",
5149
"html-webpack-plugin": "4.0.0-alpha.2",
5250
"identity-obj-proxy": "3.0.0",
5351
"jest": "23.6.0",

packages/react-scripts/scripts/utils/createJestConfig.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
3535
? '<rootDir>/node_modules/babel-jest'
3636
: resolve('config/jest/babelTransform.js'),
3737
'^.+\\.css$': resolve('config/jest/cssTransform.js'),
38-
'^.+\\.(graphql)$': resolve('config/jest/graphqlTransform.js'),
39-
'^(?!.*\\.(js|jsx|css|json|graphql)$)': resolve(
40-
'config/jest/fileTransform.js'
41-
),
38+
'^(?!.*\\.(js|jsx|css|json)$)': resolve('config/jest/fileTransform.js'),
4239
},
4340
transformIgnorePatterns: [
4441
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$',

0 commit comments

Comments
 (0)