@subql/network-query
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

@subql/network-query

Description

The package contains all the graphql queries for our dapps. This package will then generate the typescript types and queries using codegen.

The queries are split into folders which map to subquery project endpoints that are used to perform codegen.

The react-hooks package will use the queries and types from this package to generate react-hooks.

Usage

To use queries and types from this package:

import { GetIndexer, GetIndexerQuery, GetIndexerQueryVariables} from '@subql/network-query'

//example of querying using apollo client
apolloClient.query<GetIndexerQuery, GetIndexerQueryVariables>({
    query: GetIndexer,
    variables: { address },
})

To add graphql queries:

  • Add the query to correct file in /queries directory.

  • Run yarn codegen-gql to ensure the query is correct. This will output code into src/__graphql__

  • Create pull request

ChangeLogs

CHANGELOG.md

Readme

Keywords

none

Package Sidebar

Install

npm i @subql/network-query

Weekly Downloads

140

Version

1.1.1

License

Apache-2.0

Unpacked Size

6.25 MB

Total Files

120

Last publish

Collaborators

  • onfinality-admin
  • jay_ji