Skip to content

Refactor GraphQL endpoint options for clarity#9425

Open
zambianchi wants to merge 8 commits intoChilliCream:mainfrom
zambianchi:patch-1
Open

Refactor GraphQL endpoint options for clarity#9425
zambianchi wants to merge 8 commits intoChilliCream:mainfrom
zambianchi:patch-1

Conversation

@zambianchi
Copy link
Copy Markdown

This PR updates the documentation and code examples for NitroAppOptions to align with the breaking changes introduced in Hot Chocolate v16.
With the introduction of new overloads in v16 (such as the distinction between different configuration contexts), the compiler may fail to resolve the correct method.

Key Changes

  • Explicit Type Declaration: Updated examples to use explicit typing in lambda expressions (e.g., (NitroAppOptions option) => ...) to prevent AmbiguousMatchException or compilation errors.

  • Property Mapping: Refined the usage of option.Enable and option.ServeMode to reflect the latest recommended defaults for development and testing environments

Before (v15 and below):

.WithOptions(option => {
    option.Title = "My API";
})

After (v16 - Recommended):

.WithOptions((NitroAppOptions option) => {
    option.Title = "My API";
})

@github-actions github-actions bot added the 📚 documentation This issue is about working on our documentation. label Mar 23, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 23, 2026

CLA assistant check
All committers have signed the CLA.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants