0.2.0 • Published 4 years ago

fetch-graphql v0.2.0

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

fetch-graphql

Super simple GraphQL fetch client

Installing

yarn add fetch-graphql

Usage

import fetchGraphQL from 'fetch-graphql';
const query = `
  query getAllUsers {
      listAllUsers {
        items {
          uid
        }
      }
    }
`;
const variables = `
{
  "createUser": {
    "uid": "Safaiyeh"
  }
}
`
const data = await fetchGraphQL(
  'https://yourAPI.com/graphql', 
  query,
  variables,
  { 'header1': 'headerValue1', ...headers }
);

AWS AppSync

Pass your API Key to x-api-key header

const headers = {
  'x-api-key': '<AWS KEY HERE>'
}
0.2.0

4 years ago

0.1.0

4 years ago

0.1.1

4 years ago

0.0.0

4 years ago