happy-fetch

0.2.0 • Public • Published

happy-fetch

A simple GraphQL request client.

Usage

import HappyFetch from 'happy-fetch'

const graphqlQuery = `{
  users {
    _id
    name
  }
}`

try {
  const happyFetch = new HappyFetch(<API_URL>)

  const response = await happyFetch.query(graphqlQuery)

  // Do stuff with response..
} catch (error) {
  // Handle API errors..
}

Package Sidebar

Install

npm i happy-fetch

Weekly Downloads

2

Version

0.2.0

License

MIT

Last publish

Collaborators

  • adam.peryman