Subgraph and Data Indexing
OmniSocial uses The Graph to index and query on-chain data in real time.
This allows the frontend and external tools to retrieve rich, filterable data such as wallet personas, proposals, tips, and DAO governance activity.
๐งฑ Core Entities
The subgraph defines the following key entities:
Wallet
A userโs smart wallet with fields like address, .omni alias, and personas
Persona
Represents a user's persona NFT, including metadata and reputation values
DAO
A decentralized community created via the DAOFactory
Proposal
A governance proposal with state (active, passed, executed), metadata
Vote
A vote cast by a persona with support (yes/no/abstain) and reputation used
Tip
A tipping event, including sender, receiver, amount, and optional content
๐ Example GraphQL Queries
๐น Fetch all proposals in a DAO
{
proposals(where: { dao: "0xDAO_ADDRESS" }) {
id
title
description
state
createdAt
}
}๐น Get a wallet by .omni alias
๐น Show all tips received by a user
๐ Deploying the Subgraph
๐ Localhost (for dev)
From the subgraph/ folder:
Start the local Graph node (Docker)
Generate code
Build the subgraph
Create & deploy
โ Local queries:
http://localhost:8000/subgraphs/name/omnisocial
โ๏ธ Hosted Service (The Graph Hosted or Subgraph Studio)
1. Set up Graph account and auth:
2. Deploy:
๐ You can then query the hosted subgraph from your Graph Explorer dashboard.
๐งฉ Schema Overview (Partial)
๐ Common Use Cases
Show all proposals in DAO
proposals(where: { dao })
Resolve .omni alias
wallets(where: { alias })
List tips a user has received
tips(where: { receiver })
Fetch votes on a proposal
votes(where: { proposal })
List all DAOs a user interacts with
Cross-reference via votes or proposals
Last updated
Was this helpful?
