Commit a35ccc9 1 parent d54d865 commit a35ccc9 Copy full SHA for a35ccc9
File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -96,18 +96,20 @@ Then add the plugin in your `.babelrc` configuration file:
96
96
Now any ` import ` statements importing from a GraphQL file type will return a ready-to-use GraphQL DocumentNode object.
97
97
98
98
``` javascript
99
- import myImportedQuery from ' ./productsQuery.graphql'
99
+ import React , { Component } from ' react' ;
100
+ import { graphql } from ' react-apollo' ;
101
+ import myImportedQuery from ' ./productsQuery.graphql' ;
100
102
// or for files with multiple operations:
101
- // import { query1, query2 } from './queries.graphql'
103
+ // import { query1, query2 } from './queries.graphql';
102
104
103
105
class QueryingComponent extends Component {
104
106
render () {
105
- if (this .props .data .loading ) return < h3> Loading... < / h3>
106
- return < div> {` This is my data: ${ this .props .data .queryName } ` }< / div>
107
+ if (this .props .data .loading ) return < h3> Loading... < / h3> ;
108
+ return < div> {` This is my data: ${ this .props .data .queryName } ` }< / div> ;
107
109
}
108
110
}
109
111
110
- export default graphql (myImportedQuery)(QueryingComponent)
112
+ export default graphql (myImportedQuery)(QueryingComponent);
111
113
```
112
114
113
115
## Fragments
You can’t perform that action at this time.
0 commit comments