Skip to content

Commit

Permalink
docs(README): add demo link
Browse files Browse the repository at this point in the history
  • Loading branch information
evenchange4 committed Jan 19, 2018
1 parent cbaa5aa commit a7f9c15
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,26 @@ $ yarn add graphql.macro

> Note: You'll also need to install and configure [babel-plugin-macros](https://github.com/kentcdodds/babel-plugin-macros) if you haven't already.
## Example

[evenchange4/graphql.macro-example](https://github.com/evenchange4/graphql.macro-example) [[DEMO](https://graphqlmacro.netlify.com/)]

## Usage

### `loader`

```js
import { loader } from 'graphql.macro';
const query = loader('./fixtures/query.graphql');

↓ ↓ ↓ ↓ ↓ ↓

const query = {
"kind": "Document",
"definitions": [{
...
```
### `gql`
```diff
Expand All @@ -48,20 +66,6 @@ const query = {
...
```
### `loader`

```js
import { loader } from 'graphql.macro';
const query = loader('./fixtures/query.graphql');

↓ ↓ ↓ ↓ ↓ ↓

const query = {
"kind": "Document",
"definitions": [{
...
```
## Alternative
* [Webpack preprocessing with graphql/loader](https://github.com/apollographql/graphql#webpack-preprocessing-with-graphqlloader)
Expand Down

0 comments on commit a7f9c15

Please sign in to comment.