@magic-libraries/gql
graphql client library for @magic
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
...