Skip to main content

Query Proposals

This page covers all the ways to fetch proposal data from the DAO Café GraphQL API. Endpoint: https://dao.cafe/graphql

Get All Proposals

Fetch all proposals across all DAOs, ordered by creation date.
query GetAllProposals {
  proposals(limit: 10, orderBy: "createdAt", orderDirection: "desc") {
    items {
      id
      daoId
      proposer
      description
      state
      forVotes
      againstVotes
      abstainVotes
      voteStart
      voteEnd
    }
  }
}

Get Proposals by State

Filter proposals by their current state.

Active Proposals

query GetActiveProposals {
  proposals(where: { state: ACTIVE }) {
    items {
      id
      description
      forVotes
      againstVotes
      voteEnd
    }
  }
}

Pending Proposals

query GetPendingProposals {
  proposals(where: { state: PENDING }) {
    items {
      id
      description
      voteStart
    }
  }
}

Executed Proposals

query GetExecutedProposals {
  proposals(where: { state: EXECUTED }) {
    items {
      id
      description
      forVotes
      againstVotes
    }
  }
}
Available states: PENDING, ACTIVE, CANCELED, DEFEATED, SUCCEEDED, QUEUED, EXPIRED, EXECUTED

Get Proposals by DAO

Fetch all proposals for a specific DAO.
query GetDAOProposals($daoId: String!) {
  proposals(where: { daoId: $daoId }, orderBy: "createdAt", orderDirection: "desc") {
    items {
      id
      proposer
      description
      state
      forVotes
      againstVotes
      abstainVotes
      voteStart
      voteEnd
    }
  }
}
Variables:
{
  "daoId": "8453_0xGovernorAddress"
}

Get Proposal by ID

Fetch a single proposal with full details.
query GetProposal($id: String!) {
  proposal(id: $id) {
    id
    daoId
    chainId
    governor
    proposalId
    proposer
    description
    targets
    values
    calldatas
    state
    forVotes
    againstVotes
    abstainVotes
    voteStart
    voteEnd
    eta
    createdAt
    blockNumber
    transactionHash
  }
}

Get Proposals by Proposer

Find all proposals created by a specific address.
query GetProposalsByProposer($proposer: String!) {
  proposals(where: { proposer: $proposer }) {
    items {
      id
      daoId
      description
      state
      createdAt
    }
  }
}

Get Proposal with Votes

Fetch a proposal along with all votes cast.
query GetProposalWithVotes($id: String!) {
  proposal(id: $id) {
    id
    description
    state
    forVotes
    againstVotes
    abstainVotes
    votes(limit: 50, orderBy: "weight", orderDirection: "desc") {
      items {
        voter
        support
        weight
        reason
      }
    }
  }
}

Get Proposals by Chain

Filter proposals by network.
query GetBaseProposals {
  proposals(where: { chainId: 8453 }, limit: 10) {
    items {
      id
      daoId
      description
      state
    }
  }
}

Available Proposal Fields Reference

FieldTypeDescription
idStringComposite ID: chainId_governor_proposalId
daoIdStringParent DAO ID
chainIdIntNetwork chain ID
governorAddressGovernor contract
proposalIdBigIntOn-chain proposal ID
proposerAddressCreator address
descriptionStringProposal description
targets[String]Target contract addresses
values[String]ETH values for calls
calldatas[String]Encoded function calls
signatures[String]Function signatures (optional)
stateEnumCurrent proposal state
forVotesBigIntTotal FOR votes
againstVotesBigIntTotal AGAINST votes
abstainVotesBigIntTotal ABSTAIN votes
voteStartBigIntVoting start timestamp
voteEndBigIntVoting end timestamp
etaBigIntExecution time (when queued)
createdAtBigIntCreation timestamp
blockNumberBigIntCreation block
transactionHashHexCreation tx hash