Skip to content

Commit e6c198d

Browse files
lyskos97nodkz
authored andcommitted
docs: fix code example
1 parent ad856b1 commit e6c198d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
88
[![Greenkeeper badge](https://badges.greenkeeper.io/graphql-compose/graphql-compose-json.svg)](https://greenkeeper.io/)
99

10-
This is a plugin for [graphql-compose](https://github.com/nodkz/graphql-compose), which generates GraphQLTypes from REST response or any JSON. It takes fields from object, determines their types and construct GraphQLObjectType with same shape.
10+
This is a plugin for [graphql-compose](https://github.com/nodkz/graphql-compose), which generates GraphQLTypes from REST response or any JSON. It takes fields from object, determines their types and construct GraphQLObjectType with same shape.
1111

1212
## Demo
1313

@@ -91,7 +91,9 @@ const schema = new GraphQLSchema({
9191
person: {
9292
type: PersonTC.getType(), // get GraphQL type from PersonTC
9393
args: {
94-
id: new GraphQLNonNull(GraphQLInt),
94+
id: {
95+
type: new GraphQLNonNull(GraphQLInt),
96+
}
9597
},
9698
resolve: (_, args) =>
9799
fetch(`https://swapi.co/api/people/${args.id}/`).then(r => r.json()),
@@ -100,7 +102,9 @@ const schema = new GraphQLSchema({
100102
}),
101103
});
102104
```
105+
103106
Or do the same via `graphql-compose`:
107+
104108
```js
105109
import { GQC } from 'graphql-compose';
106110

0 commit comments

Comments
 (0)