graphql client library for @magic
npm install --save-exact @magic-libraries/gql
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'
}
this library will throw an error if invalid values get passed in.
first release
require node 13.5.0
bump required node version
bump required node version to 14.15.4
update dependencies
...