parse-graphql
Version:
Parse Graphql Query.
44 lines (29 loc) • 1.48 kB
Markdown
# parse-graphql
[](https://npmjs.com/package/parse-graphql) [](https://npmjs.com/package/parse-graphql) [](https://circleci.com/gh/egoist/parse-graphql/tree/master) [](https://patreon.com/egoist) [](https://chat.egoist.moe)
Given a GraphQL source, parses it into a Document.
Throws GraphQLError if a syntax error is encountered.
This module is basically a standalone version (70KB unminified) for `require('graphql').parse` (1.8MB).
## Install
```bash
yarn add parse-graphql
```
## Usage
```js
const { parse } = require('parse-graphql')
parse(`{
user {
name
id
}
}`)
```
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
## Author
**parse-graphql** © [EGOIST](https://github.com/egoist), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by EGOIST with help from contributors ([list](https://github.com/egoist/parse-graphql/contributors)).
> [github.com/egoist](https://github.com/egoist) · GitHub [@EGOIST](https://github.com/egoist)