query IdentityNameByIndex($index: Int!) {
  identities(where: {index_eq: $index}) {
    name
  }
}

query IdentityInfo($index: Int!) {
  identities(where: {index_eq: $index}) {
    name
    certIssued(where: {active_eq: true}) {
      receiver {
        name
      }
    }
    certReceived(where: {active_eq: true}) {
      issuer {
        name
      }
    }
    linkedAccount {
      id
    }
  }
}

query IdentityNameByPubkey($pubkey: String!) {
  identities(where: {account: {id_eq: $pubkey}}) {
    name
  }
}

query LatestBlock {
  blocks(limit: 1, orderBy: height_DESC) {
    height
  }
}

query GenesisHash {
  blocks(where: {height_eq: 0}) {
    hash
  }
}