diff --git a/website/src/docs/nitro/integrations/hot-chocolate.md b/website/src/docs/nitro/integrations/hot-chocolate.md index 8ae263c3fcc..08a452e257d 100644 --- a/website/src/docs/nitro/integrations/hot-chocolate.md +++ b/website/src/docs/nitro/integrations/hot-chocolate.md @@ -29,12 +29,20 @@ In this configuration, the GraphQL service remains at the `/graphql` endpoint, a In some scenarios, you may not want to serve Nitro, e.g., in a production environment. You can disable Nitro by setting the `Enable` property to `false`: +_Before (v15 and below):_ ```csharp endpoints .MapGraphQL() .WithOptions(o => o.Enable = false); ``` +_After (v16):_ +```csharp +endpoints + .MapGraphQL() + .WithOptions((NitroAppOptions o) => o.Enable = false); +``` + # Serve Modes The `ServeMode` property controls which version of Nitro to serve. The default mode is `Latest`, serving the most recent version of Nitro from a CDN. @@ -47,12 +55,20 @@ You can also serve the embedded version (`Embedded`) of Nitro, which is included Depending on your environment or preferences, you can choose the appropriate mode: +_Before (v15 and below):_ ```csharp endpoints .MapNitroApp() .WithOptions(o => o.ServeMode = ServeMode.Embedded); ``` +_After (v16):_ +```csharp +endpoints + .MapGraphQL() + .WithOptions((NitroAppOptions o) => o.ServeMode = ServeMode.Embedded); +``` + # Configuration Options You can tailor Nitro to your needs by setting various options via `NitroAppOptions`. You can specify these options using the `WithOptions()` method in both `MapGraphQL()` and `MapNitroApp()` methods. @@ -71,6 +87,7 @@ You can tailor Nitro to your needs by setting various options via `NitroAppOptio Here is an example of how to set these options: +_Before (v15 and below):_ ```csharp endpoints .MapNitroApp() @@ -84,3 +101,18 @@ endpoints o.Enable = true; }); ``` + +_After (v16):_ +```csharp +endpoints + .MapNitroApp() + .WithOptions((NitroAppOptions o) => + { + o.ServeMode = ServeMode.Insider; + o.Title = "My GraphQL API"; + o.Document = "Query { hello }"; + o.GraphQLEndpoint = "/api/graphql"; + o.IncludeCookies = true; + o.Enable = true; + }); +```