Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Token/Item entity #28

Open
vikiival opened this issue Jul 4, 2023 · 0 comments
Open

Add Token/Item entity #28

vikiival opened this issue Jul 4, 2023 · 0 comments
Assignees
Labels
schema Requires changing schema

Comments

@vikiival
Copy link
Member

vikiival commented Jul 4, 2023

type TokenEntity @entity {
  id: ID!
  blockNumber: BigInt
  collection: CollectionEntity
  nfts: [NFTEntity!] @derivedFrom(field: "token")
  hash: String! @index
  image: String
  media: String
  name: String @index
  updatedAt: DateTime!
  createdAt: DateTime!
  count: Int!
}

The point of TokenEntity is to natively group by NFTs from same collection And same image under one entity with this we can do search, filter super easy. However this require to rapidly change schema
Id should be generated as md5(collection-cid) ?
Name would be either taken from collection of first NFT name stripped from #{number} or _{number}

Also we need to add

type NFTEntity @entity {
  token: TokenEntity!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema Requires changing schema
Projects
None yet
Development

No branches or pull requests

2 participants