Creating Dashboards

Creating Dashboards

As a fully on-chain game, Primodium supports a wide range of data that can be queried and displayed in dashboards. This guide will show you how to query decoded and encoded data from the Primodium blockchain using our GraphQL endpoint.

GraphQL Endpoint

This section assumes knowledge of GraphQL (opens in a new tab) and its related technologies.

Primodium provides a GraphQL endpoint for querying decoded on-chain data, which can be used to create dashboards. The endpoint is a Hasura (opens in a new tab) instance that provides a GraphQL API over our internal Primodium indexer database.

https://graphql.primodium.ai/v1/graphql

We recommend using a GraphQL playground to introspect our schema, such as the following:

Refer to the Hasura docs (opens in a new tab) for more information on advanced querying.

Quickstart

NOTE: Currently, tables and its fields are exposed; however, full data type support and relations are missing due to the nature of how are decoded data is stored.

For this guide, we will use Apollo Studio to read Primodium data from our GraphQL endpoint.

  1. Visit Apollo Studio (opens in a new tab).
  2. Set the sandbox url to our endpoint on the top-left field: https://graphql.primodium.ai/v1/graphql

Apollo Studio

  1. Query away with the following examples:

Query Decoded Data

This example queries the top 10 scores of the current round:

query Top10Score {
  viewScore(limit: 10, orderBy: { value: DESC }) {
    entity
    value
  }
}

Query Encoded Data

This example queries MUD records between a block range:

query MudRecords(
  $where: MudRecordsBoolExp = { blockNumber: { _lte: 4824475, _gte: 4823475 } }
  $limit: Int = 1000
) {
  mudRecords(where: $where, limit: $limit) {
    address
    blockNumber
    dynamicData
    encodedLengths
    isDeleted
    key0
    key1
    keyBytes
    logIndex
    staticData
    tableId
  }
}

React Template

  • react-client-lite: Minimal setup to start creating read-only clients with the Primodium GraphQL endpoint.