Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

happy-fetch

x0bile37MIT0.2.0

A simple GraphQL request client.

happy, fetch, graphql, simple, request

readme

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..
}