@inverter-network/graphql
v0.9.31
Published
INVERTER GraphQL SDK
Readme
Inverter / GraphQL Typesafe / Query / Subscription
GraphQL Typesafe / Query / Subscription for InverterNetwork.
Summary
This package contains < GraphQL Typesafe / Query / Subscription > for InverterNetwork.
Check out the Changelog to see what changed in the last releases.
Install
pnpm add @inverter-network/graphqlUsage
import { Client, query, subscription } from '@inverter-network/graphql'
// By default, the client will use the hardcoded url -> InverterNetwork Production
Client.updateUrl('<OPTIONAL_GRAPHQL_URL>')
const fields = {
Token: {
__args: {
where: {
address: {
_eq: '0x961bB3932A7efAa9aDcc7409e1fea090479E8312',
},
chainId: {
_eq: 1101,
},
},
},
chainId: 1,
address: 1,
name: 1,
decimals: 1,
symbol: 1,
totalSupply: 1,
},
} as const
// Query
const tokens = await query(fields)
// Subscription
const sub = subscription(fields)
sub.addCallback((data) => {
console.log(data)
})License
This package is licensed - see the LICENSE file for details.
