# notes: reading code from m1guel **Published by:** [sweetman](https://paragraph.com/@sweetman/) **Published on:** 2022-06-06 **URL:** https://paragraph.com/@sweetman/notes-reading-code-from-m1guel ## Content why am I reading M1guel’s code?M1guel is building an app every day on Lens Protocol. I want to grow as a dev as well as understand web3 social media built in the Ethereum scaling ecosystem (Polygon sidechain). Instead of starting from zero, I want to study a successful dev who’s already laid down a base camp. https://twitter.com/StaniKulechov/status/1532452161258504205?s=20&t=e2DImCU-TAkSfoSIz3BM1Q Today I started by looking at M1guel’s Leaderboard app:Goal: filter the existing Leaderboard code to only show Lens Profiles that own a Mint Songs token.Leaderboard App: https://leaderboard.withlens.app/https://twitter.com/m1guelpf/status/1528787667957186562?s=20&t=e2DImCU-TAkSfoSIz3BM1QHow do I filter this on Mint Songs data?Okay, I obviously need to dig deeper into understanding the Typescript, but what’s my goal? I want to filter the existing Leaderboard code to only show Lens Profiles that own a Mint Songs token. How do I:Filter Lens Profiles based on NFT ownership?Add a “Mint Songs” tab to this list?Minimize the number of blockchain queries?Next Steps:Log the overall response from the current graphQL query.seek first to understand.Add a “Mint Songs” tab with no functionality.do the simplest thing that could possible work.Filter Lens Profiles based on NFT ownership.start with the end in mind.random thoughtsoh cool, localhost:3000, shows the same experience as prod.out-of-box perfection.super easy to start.Typescript - my nemesis.How should I respond? I’ll need to rip this out. Well, you say you like learning. What if you learned Typescript? just for this project, pretend Typescript is perfect & seek to understand.How does the Leaderboard query Lens Protocol?src/queries/explore-profiles.ts - uses graphQL.import { gql } from '@apollo/client' ## Publication Information - [sweetman](https://paragraph.com/@sweetman/): Publication homepage - [All Posts](https://paragraph.com/@sweetman/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@sweetman): Subscribe to updates ## Optional - [Collect as NFT](https://paragraph.com/@sweetman/notes-reading-code-from-m1guel): Support the author by collecting this post - [View Collectors](https://paragraph.com/@sweetman/notes-reading-code-from-m1guel/collectors): See who has collected this post