-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Query dynamic cache key computation #12814
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Major performance optimizations for metadata handling and localization, particularly around field metadata resolution and caching.
- Improved caching in
engine/api/graphql/graphql-config/hooks/use-cached-metadata.ts
by implementing SHA-256 query hashing to prevent cache collisions - Optimized
field-metadata.service.ts
by converting async operations to sync and simplifying locale handling - Enhanced
DataloaderService
indataloader.service.ts
to batch field metadata localization, preventing N+1 queries - Streamlined
object-metadata.resolver.ts
to handle locale information at the resolver level for better query optimization
5 files reviewed, 3 comments
Edit PR Review Bot Settings | Greptile
packages/twenty-server/src/engine/api/graphql/graphql-config/hooks/use-cached-metadata.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/dataloaders/dataloader.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/dataloaders/dataloader.service.ts
Outdated
Show resolved
Hide resolved
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:2799 This environment will automatically shut down when the PR is closed or after 5 hours. |
packages/twenty-server/src/engine/api/graphql/graphql-config/hooks/use-cached-metadata.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/dataloaders/dataloader.service.ts
Outdated
Show resolved
Hide resolved
async resolveOverridableString( | ||
fieldMetadata: FieldMetadataDTO, | ||
resolveOverridableString( | ||
fieldMetadata: Pick< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Record args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could fall in love for less
📊 API Changes ReportREST API ChangesSummary🔄 Changed Operations (63)
|
In this PR: - add query hashKey to ObjectMetadataItems query graphql cache to avoid caching outdated queries - improve performance by removing ResolveField at FieldLevel and adding this at resolver level
In this PR: