atlas icon indicating copy to clipboard operation
atlas copied to clipboard

Make possible to add NFTs to existing featured NFTs

Open drillprop opened this issue 1 year ago • 2 comments

Context Currently, an operator can only set an array of ids, and once he set them, all the previously featured NFTs will be overwritten. For example, if an operator runs:

mutation {
    setFeaturedNfts(featuredNftsIds: ["1", "2"]) {
        newNumberOfNftsFeatured
    }
}

and then let's say he wants to add more NFTs to the existing set, If he runs:

mutation {
    setFeaturedNfts(featuredNftsIds: ["3", "4"]) {
        newNumberOfNftsFeatured
    }
}

The featured NFTs will be only “3” and “4”.

To fix this he needs to provide all the ids, so in the case above, he would have to write this mutation:

mutation {
    setFeaturedNfts(featuredNftsIds: ["1", "2", "3", "4"]) {
        newNumberOfNftsFeatured
    }
}

Solution Introduce:

  • addFeaturedNfts mutation
  • removeFeaturedNfts mutation

drillprop avatar May 09 '23 09:05 drillprop