File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 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
1111yarn add --dev graphql-import-loader
1212```
1313
14- ## Usage
15-
1614Add 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+ ```
You can’t perform that action at this time.
0 commit comments