Skip to content

Commit 2ac1f60

Browse files
committed
docs: Update README.md with more a detalied example
Show directory tree and use relative paths in the example.
1 parent bac9499 commit 2ac1f60

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

Diff for: README.md

+18-5
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,25 @@ yarn add --dev graphql-import-loader
1313

1414
## Usage
1515

16-
Resolve GraphQL file import statements as a string. See the tests for more details
16+
Resolve GraphQL file import statements with relative paths. See the tests for more details
17+
18+
```
19+
.
20+
├── src
21+
│   ├── index.js
22+
│   └── schema
23+
│   ├── a.graphql
24+
│   ├── b.graphql
25+
│   ├── main.graphql
26+
│   └── subdir
27+
│   └── cd.graphql
28+
└── webpack.config.js
29+
```
1730

1831
```graphql
19-
# import { A } from 'src/schema/a.graphql'
20-
# import { B } from 'src/schema/b.graphql'
21-
# import { C, D } from 'src/schema/cd.graphql'
32+
# import { A } from './a.graphql'
33+
# import { B } from './b.graphql'
34+
# import { C, D } from './subdir/cd.graphql'
2235

2336
type Complex {
2437
id: ID!
@@ -30,7 +43,7 @@ type Complex {
3043
```
3144

3245
```js
33-
import typeDefs from './schema.graphql'
46+
import typeDefs from './schema/main.graphql'
3447
```
3548

3649
```js

0 commit comments

Comments
 (0)