Skip to content

Commit 8574b79

Browse files
author
Jamie Greeff
committed
update README and repository
1 parent c491cca commit 8574b79

File tree

2 files changed

+84
-3
lines changed

2 files changed

+84
-3
lines changed

README.md

+79
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,82 @@ GraphQLite
22
=======
33

44
GraphQLite is an experimental implementation of Facebook's GraphQL.
5+
6+
## Installation
7+
8+
```sh
9+
$ npm install graphqlite
10+
```
11+
12+
## Usage
13+
14+
GraphQLite exposes a simple API for parsing GraphQL (uses ES6 multi-line strings).
15+
16+
```javascript
17+
var graphqlite = require('graphqlite')
18+
19+
var output = graphqlite.parse(`
20+
node(123) {
21+
id,
22+
name,
23+
birthdate {
24+
month,
25+
day,
26+
},
27+
friends.first(1) {
28+
cursor,
29+
node {
30+
name
31+
}
32+
}
33+
}
34+
`)
35+
```
36+
37+
In the above example, `output` will be:
38+
39+
```javascript
40+
[
41+
{
42+
calls: [{ type: 'node', param: 123 }],
43+
fields: {
44+
id: true,
45+
name: true,
46+
birthdate: {
47+
calls: [],
48+
fields: {
49+
month: true,
50+
day: true
51+
}
52+
},
53+
friends: {
54+
calls: [ { type: 'first', param: 1 }],
55+
fields: {
56+
cursor: true,
57+
node: {
58+
calls: [],
59+
fields: {
60+
name: true
61+
}
62+
}
63+
}
64+
}
65+
}
66+
}
67+
]
68+
```
69+
70+
## Roadmap
71+
Facebook will be releasing a GraphQL module in the future, but I didn't know what to expect from this
72+
so I created this basic one as an experiment.
73+
Therefore this module could become obselete in the future.
74+
75+
I do plan on adding some additional features though:
76+
- GraphQL generation from object
77+
- Other ideas welcome
78+
79+
## License
80+
81+
Licensed under the MIT License.
82+
83+
View the full license [here](https://raw.githubusercontent.com/madjam002/graphqlite/master/LICENSE).

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
"graphql",
1616
"react"
1717
],
18+
"repository": {
19+
"type": "git",
20+
"url": "git://github.com/madjam002/graphqlite.git"
21+
},
1822
"author": "Jamie Greeff <[email protected]>",
1923
"license": "MIT",
20-
"dependencies": {
21-
"pegjs": "^0.8.0"
22-
},
24+
"dependencies": {},
2325
"devDependencies": {
2426
"babel-jest": "^4.0.0",
2527
"jest-cli": "^0.4.0"

0 commit comments

Comments
 (0)