@saltyaom/gq
TypeScript icon, indicating that this package has built-in type declarations

1.1.9 • Public • Published

@saltyaom/gq

Light version of @saltyaom/gql at 500 bytes.

Feature

  • No dependencies.
  • GraphQL at bare minimum.
  • Supports on both client and server.
  • Minify query on flies
  • Built-in TypeScript

Size

Should be around 500 bytes, checkout Bundlephobia for accurate result.

Getting start

yarn add @saltyaom/gq

// Or npm
npm install @saltyaom/gq --save

Example

import gql, { client } from '@saltyaom/gq'

client.config('http://api.opener.studio/graphql')

gql(`
  query GetHentaiById($id: Int!) {
    getHentaiById(id: $id) {
      success
      data {
        title {
          display
        }
      }
    }
  }
`,
{
  variables: {
    id: 177013
  }
}).then((data) => console.log(data))

Why

Y'll made GraphQL too complex and heavy.

I just want to fetch GraphQL query here.

Example

import gql, { client } from '@saltyaom/gq'

client.config('http://api.opener.studio/graphql')

gql(`
  query GetHentaiById($id: Int!) {
    getHentaiById(id: $id) {
      success
      data {
        title {
          display
        }
      }
    }
  }
`,
{
  variables: {
    id: 177013
  }
}).then((data) => console.log(data))

Dependencies (1)

Dev Dependencies (2)

Package Sidebar

Install

npm i @saltyaom/gq

Weekly Downloads

5

Version

1.1.9

License

MIT

Unpacked Size

50.1 kB

Total Files

19

Last publish

Collaborators

  • aomkirby123