npm install nanographqlTiny graphQL client library. Does everything you need with GraphQL 15 lines of
code.
js
var gql = require('nanographql')var query = gql
try {
var res = await fetch('/query', {
body: query({ name: 'Back to the Future' }),
method: 'POST'
})
var json = res.json()
console.log(json)
} catch (err) {
console.error(err)
}
`API
$3
Create a new graphql query function.$3
Create a new query object that can be sent as application/json` to a server.[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square
[1]: https://nodejs.org/api/documentation.html#documentation_stability_index
[2]: https://img.shields.io/npm/v/nanographql.svg?style=flat-square
[3]: https://npmjs.org/package/nanographql
[4]: https://img.shields.io/travis/yoshuawuyts/nanographql/master.svg?style=flat-square
[5]: https://travis-ci.org/yoshuawuyts/nanographql
[6]: https://img.shields.io/codecov/c/github/yoshuawuyts/nanographql/master.svg?style=flat-square
[7]: https://codecov.io/github/yoshuawuyts/nanographql
[8]: http://img.shields.io/npm/dm/nanographql.svg?style=flat-square
[9]: https://npmjs.org/package/nanographql
[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[11]: https://github.com/feross/standard