Querying NFTs
Querying Available NFT Models
In order to display the NFT content available for your app, use the nftModels
API. This query returns all the NFTModel
that you have marked as Available in the Admin Portal
Recall that an NFTModel is basically a blueprint for an NFT -- it contains all the content and metadata that would get minted into an NFT. You can limit the supply of NFTs for an NFTModel by setting its quantity
appropriately (using the Admin Portal as follows).
query NFTModelsQuery($filter: NFTModelFilterInput) {
nftModels(filter: $filter) {
id
blockchainId
title
description
quantity
status
rarity
content {
files {
media {
url
contentType
}
thumbnail {
url
contentType
}
}
poster {
url
}
}
}
}
Note: You can do some rich filtering on which NFTModels to display in your application using the (optional) NFTModelFilterInput parameter.
Querying User NFTs
Use the nfts
query to get NFT's
belonging to the currently logged-in user. Like the nftModels
query, you can optionally filter this query as needed (by particular NFTModel
's, for example).
nfts - Gets all NFT's belonging to the current AppUser context.
query NFTsQuery($filter: NFTFilterInput) {
nfts(filter: $filter) {
id
blockchainId
serialNumber
metadata
model {
id
}
wallet {
address
}
status
}
}
Last updated
Was this helpful?