> ## Documentation Index
> Fetch the complete documentation index at: https://dao.cafe/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Proposals

> All methods for fetching governance proposals from the GraphQL API

# 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.

```graphql theme={null}
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

```graphql theme={null}
query GetActiveProposals {
  proposals(where: { state: ACTIVE }) {
    items {
      id
      description
      forVotes
      againstVotes
      voteEnd
    }
  }
}
```

### Pending Proposals

```graphql theme={null}
query GetPendingProposals {
  proposals(where: { state: PENDING }) {
    items {
      id
      description
      voteStart
    }
  }
}
```

### Executed Proposals

```graphql theme={null}
query GetExecutedProposals {
  proposals(where: { state: EXECUTED }) {
    items {
      id
      description
      forVotes
      againstVotes
    }
  }
}
```

<Note>
  Available states: `PENDING`, `ACTIVE`, `CANCELED`, `DEFEATED`, `SUCCEEDED`, `QUEUED`, `EXPIRED`, `EXECUTED`
</Note>

***

## Get Proposals by DAO

Fetch all proposals for a specific DAO.

```graphql theme={null}
query GetDAOProposals($daoId: String!) {
  proposals(where: { daoId: $daoId }, orderBy: "createdAt", orderDirection: "desc") {
    items {
      id
      proposer
      description
      state
      forVotes
      againstVotes
      abstainVotes
      voteStart
      voteEnd
    }
  }
}
```

Variables:

```json theme={null}
{
  "daoId": "1_0xGovernorAddress"
}
```

***

## Get Proposal by ID

Fetch a single proposal with full details.

```graphql theme={null}
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.

```graphql theme={null}
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.

```graphql theme={null}
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.

```graphql theme={null}
query GetEthereumProposals {
  proposals(where: { chainId: 1 }, limit: 10) {
    items {
      id
      daoId
      description
      state
    }
  }
}
```

***

## Available Proposal Fields Reference

| Field             | Type      | Description                                                           |
| ----------------- | --------- | --------------------------------------------------------------------- |
| `id`              | String    | Composite ID: `chainId_governor_proposalId`                           |
| `daoId`           | String    | Parent DAO ID                                                         |
| `chainId`         | Int       | Network chain ID                                                      |
| `governor`        | Address   | Governor contract                                                     |
| `proposalId`      | BigInt    | On-chain proposal ID                                                  |
| `proposer`        | Address   | Creator address                                                       |
| `description`     | String    | Proposal description                                                  |
| `targets`         | \[String] | Target contract addresses                                             |
| `values`          | \[String] | ETH values for calls                                                  |
| `calldatas`       | \[String] | Encoded function calls                                                |
| `signatures`      | \[String] | Function signatures (optional)                                        |
| `decodedActions`  | \[JSON]   | Human-readable decoded actions ([see docs](/indexer/decoded-actions)) |
| `state`           | Enum      | Current proposal state                                                |
| `forVotes`        | BigInt    | Total FOR votes                                                       |
| `againstVotes`    | BigInt    | Total AGAINST votes                                                   |
| `abstainVotes`    | BigInt    | Total ABSTAIN votes                                                   |
| `voteStart`       | BigInt    | Voting start timestamp                                                |
| `voteEnd`         | BigInt    | Voting end timestamp                                                  |
| `eta`             | BigInt    | Execution time (when queued)                                          |
| `createdAt`       | BigInt    | Creation timestamp                                                    |
| `blockNumber`     | BigInt    | Creation block                                                        |
| `transactionHash` | Hex       | Creation tx hash                                                      |
