Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@magic-libraries/gql

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magic-libraries/gql

@magic-libraries/gql turn graphql queries into json.

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

@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
  • usage

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

...

Keywords

magic

FAQs

Package last updated on 02 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts