Skip to content

Latest commit

 

History

History
80 lines (63 loc) · 2.12 KB

README.md

File metadata and controls

80 lines (63 loc) · 2.12 KB

@magic-libraries/gql

graphql client library for @magic

html-docs

NPM version Linux Build Status Windows Build Status Coverage Status Greenkeeper badge Known Vulnerabilities

installation

npm install --save-exact @magic-libraries/gql

usage

in a page/component, just use the lib.gql function'),

const query = lib.gql(`query getHuman($id: Int) {
  human(id: $id) {
    name
    height
  }
}`)

const result = query(1)

// returns valid json with the following structure:
{
  query: `query getHuman($id: Int = 3) {
    human(id: $id) {
      name
      height
    }
  }`,
  variables: '1',
  operationName: 'getHuman'
}

caveat

this library will throw an error if invalid values get passed in.

0.0.1

first release

0.0.2

require node 13.5.0

0.0.3

bump required node version

0.0.4

bump required node version to 14.15.4

0.0.5

update dependencies

0.0.6 - unreleased

...