Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
schickling committed Mar 1, 2018
1 parent e9c8f82 commit 17d53d2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Webpack loader for [`graphql-import`](https://github.com/graphcool/graphql-impor
yarn add --dev graphql-import-loader
```

## Usage

Add the following to the `rules` section in your `webpack.config.js`

```js
Expand All @@ -22,3 +20,16 @@ Add the following to the `rules` section in your `webpack.config.js`
use: [{ loader: 'graphql-import-loader' }]
}],
```

## Usage

You can now `require` or `import` `.graphql` files (resolved as strings) in your application:

```ts
import { GraphQLServer } from 'graphql-yoga'
import resolvers from './resolvers'
import typeDefs from './schema.graphql'

const server = new GraphQLServer({ typeDefs, resolvers })
server.start(() => console.log('Server running on :4000'))
```

0 comments on commit 17d53d2

Please sign in to comment.