Queries

The query type defines GraphQL operations to retrieve data from the server. GraphQL queries are inherently hierarchical, composed from the Query type.

All queries commence at the root, serving as the schema's entry point. As you define a query, you can delve deeper into each object, requesting specific fields. This nested structure allows for precise data retrieval, letting you get as granular or as broad as you need. Therefore, by following the relationships between objects, you can craft queries of varying complexity. Unlike RESTful services, which might necessitate multiple round-trips (especially resource-intensive on mobile networks) or intricate SQL join statements, GraphQL naturally follows relationships between objects.

viewer

Type: User!

Fetches the currently authenticated user, often referred to as the viewer. Initiates the retrieval of a user's membership to an organization, which can be further resolved via the organizations field. Serves as the primary entry point for all user-related queries.

network

Type: Network

Lookup a network's details.

Arguments for network

Name

Description

networkId ID

The network identifier, a UUID string.

caip2 ID

The CAIP-2 identifier of the network.

networks

Type: PaginatedNetwork!

Paginate through all networks supported by the levain platform.

Arguments for networks

Name

Description

first Int

The number of items to return per page.

after String

The forward cursor to start returning items from. |->|->|->

before String

The backward cursor to start returning items from. <-|<-|<-|

protocolTypes [ProtocolType!]

Optionally filter by the protocol type of the network.

networkFamilies [NetworkFamily!]

Optionally filter by the network family of the network.

asset

Type: NetworkAsset

Retrieves the details of an asset.

Arguments for asset

Name

Description

caip19 ID

The CAIP-19 asset identifier.

identifier ID

The CAIP-19 asset identifier. An alias for caip19.

networkAssetId ID

The system-generated ID of the network asset.

organization

Type: Organization!

Lookup an organization by its orgId. All organization sub-queries are protected by a role-based authorization logic with different filter applied to different roles dependent of the user's role in the organization. This is the root query for all organization-driven functionality with all other queries nested under this one.

Arguments for organization

Name

Description

orgId ID!

A unique 12-digit identifier of an organization.

walletDepositAddress

Type: WalletDepositAddress!

Lookup a WalletDepositAddress by its walletDepositAddressId.

Arguments for walletDepositAddress

Name

Description

walletDepositAddressId ID!

The system-generated unique ID of the wallet deposit address.

wallet

Type: Wallet!

Lookup a wallet by its walletId.

Arguments for wallet

Name

Description

walletId ID!

The system-generated unique ID of the wallet.