Skip to content

Add OperationRequestBuilder.AddFile#9730

Merged
tobias-tengler merged 4 commits into
mainfrom
tte/hotchocolate-testing
May 26, 2026
Merged

Add OperationRequestBuilder.AddFile#9730
tobias-tengler merged 4 commits into
mainfrom
tte/hotchocolate-testing

Conversation

@tobias-tengler

Copy link
Copy Markdown
Member

No description provided.

@tobias-tengler tobias-tengler force-pushed the tte/hotchocolate-testing branch from dbb044e to fd31d92 Compare May 26, 2026 09:24
@tobias-tengler tobias-tengler changed the title Add OperationRequestBuilder.SetFiles Add OperationRequestBuilder.AddFile May 26, 2026
@github-actions github-actions Bot added the 📚 documentation This issue is about working on our documentation. label May 26, 2026
@tobias-tengler tobias-tengler marked this pull request as ready for review May 26, 2026 09:51
Copilot AI review requested due to automatic review settings May 26, 2026 09:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a first-class way to associate uploaded files with an OperationRequestBuilder so Upload variables can be resolved via the IFileLookup feature, and updates docs/tests accordingly.

Changes:

  • Added OperationRequestBuilderExtensions.AddFile(string name, IFile file) to register files on an operation request via an internal IFileLookup implementation.
  • Added OperationRequestFileLookup as the internal, mutable IFileLookup used by AddFile.
  • Updated the v15→v16 migration guide to recommend AddFile instead of manually wiring IFileLookup, and added unit tests for the new API.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md Updates migration guidance to use AddFile for Upload variables and removes the manual IFileLookup example.
src/HotChocolate/Core/test/Execution.Abstractions.Tests/Execution/OperationRequestBuilderExtensionsTests.cs Adds unit tests covering AddFile registration and argument validation behavior.
src/HotChocolate/Core/src/Execution.Abstractions/Execution/OperationRequestFileLookup.cs Introduces internal IFileLookup implementation to store files by key.
src/HotChocolate/Core/src/Execution.Abstractions/Execution/Extensions/OperationRequestBuilderExtensions.cs Adds the AddFile extension method and wires it to the features collection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tobias-tengler tobias-tengler merged commit 79c649c into main May 26, 2026
144 checks passed
@tobias-tengler tobias-tengler deleted the tte/hotchocolate-testing branch May 26, 2026 10:10
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.

2 participants