cardano-graphql icon indicating copy to clipboard operation
cardano-graphql copied to clipboard

No metadata in paymentAddress query

Open xray-robot opened this issue 4 years ago • 4 comments

No metadata in the following query:

query paymentAddressSummary {
  paymentAddresses(
    addresses: [
      "addr1q856yfy7yfc7hv2p8prx4djyu7wmnj3v36ez8eexrupvyugzyu8ye3d6u3f30g2mn2r02rjkc9uzsz3et2ykhvgjy0kqyax9sc"
    ]
  ) {
    summary(atBlock: 6030397) {
      utxosCount
      assetBalances {
        quantity
        asset {
          assetName
          policyId
          fingerprint
          assetId
          tokenMints {
            quantity
            transaction {
              hash
              metadata {
                key
                value
              }
            }
          }
        }
      }
    }
  }
}

xray-robot avatar Jul 27 '21 21:07 xray-robot

Unfortunately this is a known limitation as the resolver only returns the hash in this context. We either need to type this response separately, or change the design to make it work as expected. In the mean-time I suggest using the following query as a base, then include the fields currently missing:

https://github.com/input-output-hk/cardano-graphql/blob/754d9e9acc31a75b3f786cac5553bd3155e6a968/packages/api-cardano-db-hasura/src/HasuraClient.ts#L335-L405

rhyslbw avatar Jul 28 '21 09:07 rhyslbw

Thanks for the clarification

xray-robot avatar Jul 28 '21 09:07 xray-robot

I'll leave this issue open since it's unresolved

rhyslbw avatar Jul 28 '21 10:07 rhyslbw

Hi seem like this is not resolved yet, did anyone find manage to find a workaround? Querying all assets based on policy id and remapping through asset id is an option but not so elegant solution.

ryanzh98 avatar Jul 28 '22 14:07 ryanzh98