2.1.3 • Published 4 years ago

nanographql-esm v2.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

nanographql-esm

npm version Node.js CI

Tiny graphQL client library. Does everything you need with GraphQL 15 lines of code.

Usage

import gql from 'nanographql-esm'

var query = gql`
  query($name: String!) {
    movie (name: $name) {
      releaseDate
    }
  }
`

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

query = gql(string)

Create a new graphql query function.

json = query([data])

Create a new query object that can be sent as application/json to a server.

License

MIT

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago