cardano-foundation / cardano-graphql

GraphQL API for Cardano
Apache License 2.0
261 stars 103 forks source link

No metadata in paymentAddress query #554

Open xray-robot opened 3 years ago

xray-robot commented 3 years ago

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
              }
            }
          }
        }
      }
    }
  }
}
rhyslbw commented 3 years ago

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

xray-robot commented 3 years ago

Thanks for the clarification

rhyslbw commented 3 years ago

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

ryanzh98 commented 2 years ago

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.