Skip to content

Fetch council motions from squid #264

@ishrak-imam

Description

@ishrak-imam

Since we have started to display the past proposals in the app the resolver for the council motions needs to be updated to fetch data from the squid. The resolver should also handle pagination.

If any additional formatting is needed over the squid data such as, returning the full substrate account information, relative time from a block number, human readable formatting of balance data from chain etc. should also be done in the custom resolvers of the graph.

For reference this #262 is the PR where we did the same for democracy proposals.

For now we are not adding the on chain call information of the proposals (will be included when added in squid). For that and also in general we may need to update the typedefs for council in the graph too. For reference the above mentioned PR can also be checked.

Following is a sample query from squid that we will be executing in the graph and proxy the data to a client that is using the graph.

  substrateCouncilProposals(limit: 2, where: {network_eq: polkadot}, orderBy: date_DESC) {
    ayeCount
    blockNumber
    date
    id
    lastUpdate
    method
    nayCount
    network
    pallet
    proposalHash
    proposalId
    proposalIndex
    status
    threshold
    account {
      id
    }
    votes {
      approve
      blockNumber
      date
      id
      account {
        id
      }
    }
  }
}

We will need some extra information from squid to fully support the app based on currently displayed information and there is a ticket litentry/squid#127 for that extra data in the squid repository.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions