@genql/thegraph
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

thegraph.com TypeScript API client

GraphQL client for thegraph.com with full TypeScript support

Installation

npm install @genql/thegraph

Docs

You can read more about usage in the client docs and Genql docs

Example usage

import { createClient } from '@genql/thegraph'
const client = createClient()


// query variables
let subgraphId = ''

client
  .query({
    apiVersions: {
      __args: {
        subgraphId: subgraphId,
      },
      version: true,
    },
  })
  .then((x) => console.log(JSON.stringify(x, null, 4)))



// query variables
let blockHash
let network = ''

client
  .query({
    blockData: {
      __args: {
        blockHash: blockHash,
        network: network,
      },
    },
  })
  .then((x) => console.log(JSON.stringify(x, null, 4)))

Sponsor

This project is sponsored by Notaku: Create public docs websites from your Notion pages

Notaku

Package Sidebar

Install

npm i @genql/thegraph

Weekly Downloads

2

Version

0.0.0

License

none

Unpacked Size

159 kB

Total Files

51

Last publish

Collaborators

  • xmorse