Skip to content

Conversation

tobias-tengler
Copy link
Member

No description provided.

@Copilot Copilot AI review requested due to automatic review settings October 10, 2025 19:19
@github-actions github-actions bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Oct 10, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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/AddOperationCache methods to SchemaOptions properties
  • 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.

@tobias-tengler tobias-tengler force-pushed the tte/move-cache-configuration-to-options branch from e5d91a1 to 56f1043 Compare October 10, 2025 19:33
static sp =>
{
var options = sp.GetRequiredService<SchemaOptions>();
return new DefaultDocumentCache(options.OperationDocumentCacheSize);
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: This is not good. It will re-create the cache for each executor.
We need it scoped to a specific schema, but not executor.

@tobias-tengler tobias-tengler marked this pull request as draft October 14, 2025 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant