Skip to main content

Query Functions

All React hooks have corresponding async query functions for use in Node.js, server-side rendering, or vanilla JavaScript applications.

Overview

Query functions return Promises and can be used anywhere JavaScript runs:

DAO Functions

getDAOs

Fetch all DAOs with optional pagination and ordering.
ParameterTypeDefaultDescription
limitnumber-Max items to return
afterstring-Cursor for forward pagination
beforestring-Cursor for backward pagination
orderBystring'createdAt'Sort field
orderDirectionstring'desc'Sort direction

getDAO

Fetch a single DAO by ID.

getDAOsByManager

Fetch DAOs managed by a specific address.

Proposal Functions

getProposals

Fetch proposals with optional filters.

getProposal

Fetch a single proposal by ID.

getProposalsByDAO

Fetch proposals for a specific DAO.

getActiveProposals

Fetch all currently active proposals across all DAOs.

Vote Functions

getVotes

Fetch votes with optional filters.

getVotesByProposal

Fetch all votes for a specific proposal.

getVotesByVoter

Fetch all votes cast by a specific address.

Delegate Functions

getDelegates

Fetch delegation records.

getDelegatesByDAO

Fetch delegates for a specific DAO.

getDelegationsFrom / getDelegationsTo

Fetch delegations from or to a specific address.

Token Holder Functions

getTokenHolders

Fetch token holders.

getTokenHoldersByDAO

Fetch holders for a specific DAO.

getTokenHoldingsByAddress

Fetch all holdings for an address across all DAOs.

Custom Client

All functions accept an optional custom GraphQL client as the last parameter:
See the Advanced Guide for more details on custom clients.