graphqlfetcher

1.0.3 • Public • Published

graphql-fetch

Fetch for GraphQL requests

This function helps you to do http requests for API written in GraphQL.

Returns GraphQL response (JSON).

If errors occurred then field named errors is present.

Based on isomorphic-fetch

Usage:

import fabric from 'graphqlfetcher'
const fetch = fabric('http://som_url/graphql');

fetch(`
  query Q($input: GraphQLInputObject){
    someQuery(input:$input) {field}
  }`,
  {
    input: {
      var1: 'value1'
    }
  },
  //provide headers if needed
  {
    headers: {
      Authorization: 'Bearer some_token'
    }
  }

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    0
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i graphqlfetcher

Weekly Downloads

0

Version

1.0.3

License

ISC

Last publish

Collaborators

  • ekubyshin