File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ Webpack loader for [`graphql-import`](https://github.com/graphcool/graphql-impor
11
11
yarn add --dev graphql-import-loader
12
12
```
13
13
14
- ## Usage
15
-
16
14
Add the following to the ` rules ` section in your ` webpack.config.js `
17
15
18
16
``` js
@@ -22,3 +20,16 @@ Add the following to the `rules` section in your `webpack.config.js`
22
20
use: [{ loader: ' graphql-import-loader' }]
23
21
}],
24
22
```
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
+ ```
You can’t perform that action at this time.
0 commit comments