Lens-Graph-Subgraph icon indicating copy to clipboard operation
Lens-Graph-Subgraph copied to clipboard

Extending/adding entities

Open svskaushik opened this issue 3 years ago • 3 comments

I extended some of the existing entities with more fields and created a few new ones based on emitted events mentioned in Lens' docs

I'd appreciate some feedback on whether such additions are in line with what is planned for this subgraph or whether there's stuff I should tweak and anything else.

Thanks

svskaushik avatar May 27 '22 00:05 svskaushik

Hi @svskaushik , these entities look clean, I'm confused about the whitelisting entities like ProfileCreatorWhitelisted, FollowModuleWhitelist, ReferenceModuleWhitelist, and CollectModuleWhitelist. Are these in place to verify the user is whitelisted for the Lens Protocol? Or can users make their own whitelists?

lancenonce avatar May 27 '22 13:05 lancenonce

Hi @lndavis6, thanks for taking the time to look through! Yes, the idea behind the whitelisting entities was to keep a track of whether users are whitelisted for Lens (indexing the whitelisting events from the contract)

An example of the intended return values below if it helps. A query for profileCreatorWhitelist for the address 0x39c9bc23b1f993b94dec69b7ac11c95145ec4e15 returns the following:

{
  "data": {
    "profileCreatorWhitelists": [
      {
        "id": "0x39c9bc23b1f993b94dec69b7ac11c95145ec4e15",
        "isWhitelisted": true,
        "lastUpdated": "1649155635"
      }
    ]
  }
}

(this is from a test contract on mumbai) I guess these would just serve a similar purpose as directly reading isProfileCreatorWhitelisted from the contract, with the additional timestamp.

I hope that helps a little

svskaushik avatar May 28 '22 05:05 svskaushik

Makes sense! Thank you @svskaushik

lancenonce avatar May 28 '22 14:05 lancenonce