Closed RamRamez closed 4 weeks ago
The recent changes introduce caching mechanisms to the CategoryResolver
and qfRoundRepository
to enhance performance by reducing redundant data retrieval. Additionally, a test update ensures that main categories and their active subcategories are correctly fetched and validated. A minor comment correction was made in the configuration file.
File | Change Summary |
---|---|
src/resolvers/categoryResolver.ts | Added caching for mainCategories in the CategoryResolver class. |
src/repositories/qfRoundRepository.ts | Renamed findAllQfRounds to findQfRounds and added caching for active rounds. |
src/resolvers/categoryResolver.test.ts | Updated tests to query and assert main categories and their active subcategories using MainCategory . |
src/config.ts | Corrected a comment typo from "I thinks it's" to "I think it's". |
sequenceDiagram
participant Client
participant CategoryResolver
participant Cache
participant Database
Client->>CategoryResolver: Request main categories
CategoryResolver->>Cache: Check for cached main categories
alt Cache hit
Cache-->>CategoryResolver: Return cached categories
else Cache miss
CategoryResolver->>Database: Query main categories
Database-->>CategoryResolver: Return main categories
CategoryResolver->>Cache: Cache main categories
end
CategoryResolver-->>Client: Return main categories
In the land of code, a change so bright,
Caches now keep our queries light.
Categories swift, rounds in a breeze,
Tests ensure all works with ease.
A typo fixed, a comment clear,
Our code refined, let's give a cheer! 🎉
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
https://github.com/Giveth/giveth-dapps-v2/issues/4234
https://github.com/Giveth/giveth-dapps-v2/issues/4217
Summary by CodeRabbit
New Features
Bug Fixes
Tests