Skip to content

Commit a35ccc9

Browse files
authored
Make example complete and add semi-colons
1 parent d54d865 commit a35ccc9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/source/recipes/babel.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,20 @@ Then add the plugin in your `.babelrc` configuration file:
9696
Now any `import` statements importing from a GraphQL file type will return a ready-to-use GraphQL DocumentNode object.
9797

9898
```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';
100102
// or for files with multiple operations:
101-
// import { query1, query2 } from './queries.graphql'
103+
// import { query1, query2 } from './queries.graphql';
102104

103105
class QueryingComponent extends Component {
104106
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>;
107109
}
108110
}
109111

110-
export default graphql(myImportedQuery)(QueryingComponent)
112+
export default graphql(myImportedQuery)(QueryingComponent);
111113
```
112114

113115
## Fragments

0 commit comments

Comments
 (0)