-
-
Notifications
You must be signed in to change notification settings - Fork 799
Move cache configuration to options #8793
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
Move cache configuration to options #8793
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.
Pull Request Overview
This PR moves cache configuration from separate service collection methods to the standard GraphQL options pattern, consolidating cache size settings with other schema options for better consistency and discoverability.
Key changes include:
- Moving cache size configuration from
AddDocumentCache/AddOperationCachemethods toSchemaOptionsproperties - Adding proper validation that throws exceptions for invalid cache sizes instead of silently clamping values
- Updating documentation and tests to reflect the new configuration approach
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md | Added migration documentation showing the old vs new cache configuration patterns |
| src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Execution/FusionOptions.cs | Updated cache size validation to throw exceptions instead of silently clamping values |
| src/HotChocolate/Core/test/Execution.Tests/WarmupRequestTests.cs | Simplified service provider access by removing GetCombinedServices() calls |
| src/HotChocolate/Core/test/Execution.Tests/PreparedOperationCacheTests.cs | Updated test to use new ModifyOptions pattern instead of AddOperationCache method |
| src/HotChocolate/Core/test/Execution.Tests/DocumentCacheTests.cs | Added new test for document cache configuration using the new options pattern |
| src/HotChocolate/Core/src/Types/SchemaOptions.cs | Added cache size properties with validation and updated FromOptions method |
| src/HotChocolate/Core/src/Types/IReadOnlySchemaOptions.cs | Added cache size property definitions and fixed truncated comment |
| src/HotChocolate/Core/src/Execution/RequestExecutorManager.cs | Updated cache instantiation to use schema options instead of separate options classes |
| src/HotChocolate/Core/src/Execution/DependencyInjection/RequestExecutorServiceCollectionExtensions.cs | Removed deprecated AddDocumentCache and AddOperationCache methods |
| src/HotChocolate/Core/src/Execution/DependencyInjection/InternalServiceCollectionExtensions.cs | Removed TryAddDefaultCaches method that registered the old cache options |
| src/HotChocolate/Core/src/Execution/Caching/PreparedOperationCacheOptions.cs | Deleted obsolete cache options class |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Execution/FusionOptions.cs
Outdated
Show resolved
Hide resolved
src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Execution/FusionOptions.cs
Outdated
Show resolved
Hide resolved
e5d91a1 to
56f1043
Compare
56f1043 to
f254399
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
f254399 to
caba57d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8793 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
IRequestExecutorOptionsMonitor, since async configuration is no longer used