Skip to main content
query/client.QueryClient Query Client for interacting with The Graph API This client provides methods for querying indexed blockchain data

Table of contents

Methods

Properties

constructor

new QueryClient(environment): QueryClient Create a new QueryClient instance

Parameters

NameTypeDescription
environmentSpaceportChainTypeChain environment (e.g., “local”, “devnet”, “testnet”) or SpaceportSDK instance

Returns

QueryClient

Methods

getEnvironment

getEnvironment(): SpaceportChainType Get the current environment

Returns

SpaceportChainType

getGraphQLClient

getGraphQLClient(): Client Get the GraphQL client

Returns

Client

executeQuery

executeQuery<T, V>(query, variables?): Promise<T> Execute a GraphQL query

Type parameters

NameType
TT
Vextends Record<string, unknown> = Record<string, unknown>

Parameters

NameTypeDescription
querystringThe GraphQL query document
variables?VQuery variables

Returns

Promise<T> The query result

Properties

graphqlClient

graphqlClient: Client

environment

environment: SpaceportChainType

listings

listings: ListingsQueryModule

agreements

agreements: AgreementsQueryModule

smartLicenses

smartLicenses: SmartLicensesQueryModule