kodadot / stick

GraphQL service for Uniques and Assets on Asset Hubs
MIT License
4 stars 11 forks source link

Overwrite Entity properties via attributes #94

Open vikiival opened 1 year ago

vikiival commented 1 year ago

field as shown below can become mutable via on-chain attributes. It works same for Collections and also NFTs.

type Entity @entity {
  image: String
  media: String
  name: String @index
}

How to implement

in mappings/nfts/setAttribute check if key is image / media / name and mutate this values accordingly.

Questions

@daiagi how this logic would alter the TokenEntity?

Ref

daiagi commented 1 year ago

@vikiival As you know TokenIdenity was meant to group NFT's that share the same image into one to remove visual spam from /explorer

what is the relationship between this new Entity and other schema types?

vikiival commented 1 year ago

what is the relationship between this new Entity and other schema types?

Both CollectionEntity and NFTentity share these traits. No new Entity is introduced

daiagi commented 1 year ago

in mappings/nfts/setAttribute check if key is image / media / name and mutate this values accordingly.

since TokenEntity also has these traits, it would also need to be mutated in mappings/nfts/setAttribute