-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
11 changed files
with
1 addition
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
packages/react-scripts/fixtures/kitchensink/src/features/webpack/GraphQLInclusion.js
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
packages/react-scripts/fixtures/kitchensink/src/features/webpack/GraphQLInclusion.test.js
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
packages/react-scripts/fixtures/kitchensink/src/features/webpack/assets/graphql.graphql
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ You can find the most recent version of this guide [here](https://github.com/fac | |
- [Post-Processing CSS](#post-processing-css) | ||
- [Adding a CSS Preprocessor (Sass, Less etc.)](#adding-a-css-preprocessor-sass-less-etc) | ||
- [Adding Images, Fonts, and Files](#adding-images-fonts-and-files) | ||
- [Adding GraphQL files](#adding-graphql-files) | ||
- [Using the `public` Folder](#using-the-public-folder) | ||
- [Changing the HTML](#changing-the-html) | ||
- [Adding Assets Outside of the Module System](#adding-assets-outside-of-the-module-system) | ||
|
@@ -732,34 +731,6 @@ Please be advised that this is also a custom feature of Webpack. | |
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).<br> | ||
An alternative way of handling static assets is described in the next section. | ||
|
||
## Adding GraphQL files | ||
|
||
> Note: this feature is available with [email protected] and higher. | ||
If you are using GraphQL, you can **`import` GraphQL files in a JavaScript module**. | ||
|
||
By importing GraphQL queries instead of using a [template tag](https://github.com/apollographql/graphql-tag), they are preprocessed at build time. This eliminates the need to process them on the client at run time. It also allows you to separate your GraphQL queries from your code. You can put a GraphQL query in a file with a `.graphql` extension. | ||
|
||
Here is an example: | ||
|
||
```js | ||
// query.graphql | ||
{ | ||
githubStats(repository: "facebook/react") { | ||
stars | ||
} | ||
} | ||
|
||
// foo.js | ||
|
||
import query from './query.graphql'; | ||
|
||
console.log(query); | ||
// { | ||
// "kind": "Document", | ||
// ... | ||
``` | ||
|
||
## Using the `public` Folder | ||
|
||
>Note: this feature is available with `[email protected]` and higher. | ||
|