holaplex / indexer

Index Solana data using a Geyser plugin (downstream service cluster)
https://holaplex.com
GNU Affero General Public License v3.0
162 stars 38 forks source link

Usage example for realms calls #746

Closed ndrabins closed 2 years ago

ndrabins commented 2 years ago

Hi,

trying to implement holaplex indexer for realms calls - specifically getting governances for a realm.

Found this query:

  governances(addresses: $addresses, realms: $realms) {
    address
    governedAccount
    proposalsCount
    votingProposalCount
    governanceConfig {
      ...GovernanceConfigFragment
    }
    realm {
      ...RealmFragment
    }
  }
}

Not sure what is expected for the addresses field though. Any help would be much appreciated. Thanks!

imabdulbasit commented 2 years ago

addresses expected Governance account pubkeys

ndrabins commented 2 years ago

Thanks for the reply @imabdulbasit. If the public keys of the governance are required to query them, how do you get those governance public keys to then request the data on them through the holaplex api?

imabdulbasit commented 2 years ago

Its not required. Its one of the filter. So, if you want to query governance account data then you can either pass pubkeys of those accounts or realm pubkeys to which those governances belong to or both

ndrabins commented 2 years ago

Its not required. Its one of the filter. So, if you want to query governance account data then you can either pass pubkeys of those accounts or realm pubkeys to which those governances belong to or both

Ah okay thank you. I thought the addresses param was required. I got it to work. Much appreciated!