-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initialisation patter, improved docs
- Loading branch information
1 parent
92e6e2c
commit 8e15fbf
Showing
19 changed files
with
223 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,3 +142,7 @@ load({ | |
} | ||
}) | ||
``` | ||
|
||
--- | ||
|
||
### [Table of Contents](table-of-contents.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Grapher | ||
|
||
You can use Grapher to define your links in your types, for rapid prototyping: | ||
|
||
* [Read more about Grapher](https://github.com/cult-of-coders/grapher) | ||
* [Read more about Grapher Directives](https://github.com/cult-of-coders/grapher-schema-directives) | ||
* [Read more about Grapher & GraphQL](https://github.com/cult-of-coders/grapher/blob/master/docs/graphql.md) | ||
|
||
## Sample | ||
|
||
```js | ||
type Comment @mongo(name: "comments") { | ||
_id: ID! | ||
text: String | ||
userId: String! | ||
user: User @link(field: "userId") | ||
postId: String | ||
post: Post @link(field: "postId") | ||
createdAt: Date | ||
} | ||
``` | ||
|
||
## Query | ||
|
||
With Grapher you don't have to care about resolvers, because it knows exactly | ||
how to create your data, and does it very efficiently, speeds more than 200X in some cases: | ||
|
||
```js | ||
export default { | ||
Query: { | ||
comments(_, args, { db }) { | ||
return db.comments.astToQuery().fetch(); | ||
}, | ||
}, | ||
}; | ||
``` | ||
|
||
--- | ||
|
||
### [Table of Contents](table-of-contents.md) |
Oops, something went wrong.