2

currently I'm using blockfrost to request NFT metadata information one by one from a specific policy_id. A policy ID can have up to 10k assets minted so it takes quite a while to fully sync to my local database.

Can I define a graphql schema to do the same thing with dbsync but with just 1 or a few request to the Cardano graphql server?

Was trying on https://graphql-api.mainnet.dandelion.link/ and couldn't figure this out, any help would be appreciated, thanks.

1 Answer 1

0

Took a while for me to figure out as well but this works. It will return all the asset ids of a particular policy

query TokensByPolicy($policy_id: Hash28Hex) {
  assets(where: { policyId: { _eq: $policy_id } }) {
    assetId
    policyId
    assetName
  }
}

And you need to pass the policy id as a parameter

{"policy_id": "7be8b5c60e913079bc1ccf58247dbaf5433fcb70d0abc89a7dd333d4"}

You can try it out at https://graphql-api.mainnet.dandelion.link/

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.