Application Data

📘 Application Schema

This section describes the structure, relationships, and event mappings of the Application entities within the subgraph.

🟨 Application

type Application @entity {
  id: ID!
  name: String!
  owner: Bytes!
  records: [ApplicationRecord!]! @derivedFrom(field: "application")
  createdAt: BigInt!
  transactionHash: Bytes!
}

Represents a deployed game, app, or service set via the ApplicationSet event. Each application is uniquely identified by its name (lowercased).

Created by:

event ApplicationSet(string name, address indexed owner);

🟦 ApplicationRecord

type ApplicationRecord @entity {
  id: ID!
  application: Application!
  recordId: BigInt!
  applicationVersion: String!
  companyName: String!
  addressHistory: [ApplicationAddressSet!]! @derivedFrom(field: "record")
  metadata: [ApplicationMetadata!]! @derivedFrom(field: "record")
  createdAt: BigInt!
  transactionHash: Bytes!
}

Tracks a specific version or configuration of an application. Each new ApplicationRecord begins a fresh versioned state.

Created by:


🟧 ApplicationAddressSet

Stores the versioned list of smart contract addresses tied to the ApplicationRecord. The first address set comes from ApplicationRecordCreated (isInitial = true), while updates come later.

Created by:


🟪 ApplicationMetadata

Tracks optional metadata added to an application record, such as descriptions, tags, or config.

Created by:


📌 Relationships Summary

Entity
Relation
Description

Application → Records

One-to-Many

Each application can have many versions

Record → AddressSet

One-to-Many

Contract address history (versioned)

Record → Metadata

One-to-Many

Arbitrary key-value metadata


📚 Application Entity Structure

This page outlines the structural hierarchy of entities related to Application in the subgraph.

📦 Entity Relationship Tree

🔗 Relationship Overview

  • Application

    • Set via ApplicationSet event

    • Uniquely identified by name.toLowerCase()

    • Has many ApplicationRecord

  • ApplicationRecord

    • Created via ApplicationRecordCreated

    • References an Application

    • Stores version, company, and address history

    • Has many ApplicationAddressSet and ApplicationMetadata

  • ApplicationAddressSet

    • First one created with the record (isInitial = true)

    • Subsequent ones created via ApplicationRecordAddressesUpdated

    • Versioned list of associated smart contracts

  • ApplicationMetadata

    • Optional key-value pairs for extra metadata

    • Only created via ApplicationRecordMetadataAdded

🧠 Notes

  • Entities use @derivedFrom to establish GraphQL relationships

  • Events are the primary mechanism for updating subgraph state

Last updated