Skip to content

Commit 17d53d2

Browse files
committed
readme
1 parent e9c8f82 commit 17d53d2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Webpack loader for [`graphql-import`](https://github.com/graphcool/graphql-impor
1111
yarn add --dev graphql-import-loader
1212
```
1313

14-
## Usage
15-
1614
Add the following to the `rules` section in your `webpack.config.js`
1715

1816
```js
@@ -22,3 +20,16 @@ Add the following to the `rules` section in your `webpack.config.js`
2220
use: [{ loader: 'graphql-import-loader' }]
2321
}],
2422
```
23+
24+
## Usage
25+
26+
You can now `require` or `import` `.graphql` files (resolved as strings) in your application:
27+
28+
```ts
29+
import { GraphQLServer } from 'graphql-yoga'
30+
import resolvers from './resolvers'
31+
import typeDefs from './schema.graphql'
32+
33+
const server = new GraphQLServer({ typeDefs, resolvers })
34+
server.start(() => console.log('Server running on :4000'))
35+
```

0 commit comments

Comments
 (0)