Skip to content

Commit 085270b

Browse files
committed
Fix JSON in readme now that there are dates
1 parent 1ff5387 commit 085270b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Inspired by the excellent [json-server](https://github.com/typicode/json-server)
1313

1414
## Example
1515

16-
Create a `db.json` file.
16+
Create a `db.js` file.
1717

18-
Your data file should be an object where the keys are the entity types. The values should be lists of entities, i.e. arrays of value objects with at lead an `id` key. For instance:
18+
Your data file should export an object where the keys are the entity types. The values should be lists of entities, i.e. arrays of value objects with at least an `id` key. For instance:
1919

2020
```js
21-
{
21+
module.exports = {
2222
posts: [
2323
{ id: 1, title: "Lorem Ipsum", views: 254, user_id: 123 },
2424
{ id: 2, title: "Sic Dolor amet", views: 65, user_id: 456 },
@@ -37,7 +37,7 @@ Your data file should be an object where the keys are the entity types. The valu
3737
Start the GraphQL server on localhost, port 3000.
3838

3939
```sh
40-
json-graphql-server db.json
40+
json-graphql-server db.js
4141
```
4242

4343
Now you can query your data in graphql. For instance, to issue the following query:

0 commit comments

Comments
 (0)