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

Introduce event handlers & clean up Entity #30

Merged

Conversation

andyrobert3
Copy link
Contributor

@andyrobert3 andyrobert3 commented Nov 9, 2022

This PR aims to fix the following issues:

Fixes typo with onwedBy in ProfileCreated handler

Changes

  • Updated entities for Post, Comment & Mirror to be simpler, without the bloatware we had before
    Since the voyager map view is not available, I am basing the structure of the entities with the events emitted by Lens
    We can always add the necessary fields back for the schema, when we find an event handler that provides those values

  • Normalised the schema a bit, by adding posts, comments & mirrors into the Profile schema
    We should be combining the Post, Comment & Mirror to inherit from a superclass type Publication since they are just subclasses of it, according to the lens docs

https://docs.lens.xyz/docs/comment
https://docs.lens.xyz/docs/publication
https://docs.lens.xyz/docs/mirror

Will continue writing PR for these issues, once this PR is merged:

@naz3eh naz3eh self-requested a review November 10, 2022 09:27
Copy link
Member

@naz3eh naz3eh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments for the schema.graphql file. All other things are perfect. Thanks mate! you've done an amazing job!

schema.graphql Show resolved Hide resolved
schema.graphql Outdated Show resolved Hide resolved
schema.graphql Show resolved Hide resolved
src/lens-hub.ts Outdated
Comment on lines 53 to 73
let profile = Profile.load(event.params.profileId.toString());
log.info("Trigger Fired", []);

if (!profile) {
profile = new Profile(event.params.profileId.toString());
profile.handle = event.params.handle.toString();
profile.creator = event.params.creator.toHexString();
profile.mintedTo = event.params.to.toHexString();
profile.picture = event.params.imageURI.toString();

profile.createdAt = event.params.timestamp.toString();

// Newly set follow module, can be zero address
profile.followModule = event.params.followModule.toHexString();
profile.followModuleReturnData = event.params.followModuleReturnData;

profile.followNftUri = event.params.followNFTURI;

profile.save();
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing job mate!! @andyrobert3

This was referenced Nov 10, 2022
@naz3eh naz3eh force-pushed the feat/index-profile branch from 4b154dc to 5a9968a Compare November 11, 2022 11:00
Copy link
Member

@naz3eh naz3eh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Merging

@naz3eh naz3eh merged commit f69ef95 into Developer-DAO:feat/index-profile Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants