Skip to content

Commit

Permalink
update README and repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Greeff committed Mar 14, 2015
1 parent c491cca commit 8574b79
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 3 deletions.
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,82 @@ GraphQLite
=======

GraphQLite is an experimental implementation of Facebook's GraphQL.

## Installation

```sh
$ npm install graphqlite
```

## Usage

GraphQLite exposes a simple API for parsing GraphQL (uses ES6 multi-line strings).

```javascript
var graphqlite = require('graphqlite')

var output = graphqlite.parse(`
node(123) {
id,
name,
birthdate {
month,
day,
},
friends.first(1) {
cursor,
node {
name
}
}
}
`)
```

In the above example, `output` will be:

```javascript
[
{
calls: [{ type: 'node', param: 123 }],
fields: {
id: true,
name: true,
birthdate: {
calls: [],
fields: {
month: true,
day: true
}
},
friends: {
calls: [ { type: 'first', param: 1 }],
fields: {
cursor: true,
node: {
calls: [],
fields: {
name: true
}
}
}
}
}
}
]
```

## Roadmap
Facebook will be releasing a GraphQL module in the future, but I didn't know what to expect from this
so I created this basic one as an experiment.
Therefore this module could become obselete in the future.

I do plan on adding some additional features though:
- GraphQL generation from object
- Other ideas welcome

## License

Licensed under the MIT License.

View the full license [here](https://raw.githubusercontent.com/madjam002/graphqlite/master/LICENSE).
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
"graphql",
"react"
],
"repository": {
"type": "git",
"url": "git://github.com/madjam002/graphqlite.git"
},
"author": "Jamie Greeff <[email protected]>",
"license": "MIT",
"dependencies": {
"pegjs": "^0.8.0"
},
"dependencies": {},
"devDependencies": {
"babel-jest": "^4.0.0",
"jest-cli": "^0.4.0"
Expand Down

0 comments on commit 8574b79

Please sign in to comment.