Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions website/src/docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@
}
]
},
{
"path": "analyzers",
"title": "Analyzers"
},
{
"path": "settings",
"title": "Settings",
Expand All @@ -257,6 +261,16 @@
"title": "Key Bindings"
}
]
},
{
"path": "migration",
"title": "Migration",
"items": [
{
"path": "migrate-from-1-to-16",
"title": "Migrate from 1 to 16"
}
]
}
]
}
Expand Down
6 changes: 4 additions & 2 deletions website/src/docs/fusion/v16/deployment-and-ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Deployment and CI/CD"

This page covers the CI/CD pipelines that ship a Fusion gateway in production: uploading source schemas to Nitro from each subgraph repository, publishing a Fusion configuration to a stage after a deployment, and validating composition on pull requests before merge. Composition runs in CI, the gateway pulls the latest archive from Nitro at runtime, and no archive file is ever shipped by hand.

The gateway closes the loop with `AddNitro().AddFusion()`, which subscribes to the latest archive on the configured stage and hot-swaps it without a restart.
The gateway closes the loop with `AddNitro().AddDefaults()`, which subscribes to the latest archive on the configured stage and hot-swaps it without a restart.

# Prerequisites

Expand All @@ -24,7 +24,7 @@ The deployment pipeline is split across two jobs. The **build job** compiles eac
The runtime side is configured once on the gateway:

```csharp
builder.Services.AddNitro().AddFusion();
builder.Services.AddNitro().AddDefaults();

builder.Services
.AddGraphQLGatewayServer()
Expand All @@ -36,6 +36,8 @@ builder.Services
});
```

> **Note:** `AddDefaults()` is generated by a source generator in the `ChilliCream.Nitro` package. It requires the `ChilliCream.Nitro.Fusion` package to be referenced in your project. If `AddDefaults()` is not available, verify your package references or use the explicit `.AddFusion()` method instead. See the [Analyzers](/docs/nitro/analyzers) page for details.

With the runtime in place, every successful `nitro fusion publish` becomes the new configuration the gateway serves traffic against. You don't ship the archive yourself.

## Upload the source schema
Expand Down
12 changes: 9 additions & 3 deletions website/src/docs/fusion/v16/guides/first-party-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ The Fusion gateway does not need `UsePersistedOperationPipeline()` because the g
First, add the `ChilliCream.Nitro.Fusion` package to your gateway project:

```bash
dotnet add package ChilliCream.Nitro
dotnet add package ChilliCream.Nitro.Fusion
```

Expand All @@ -38,9 +39,10 @@ Then configure the gateway:
```csharp
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddNitro().AddDefaults();

builder
.AddGraphQLGateway()
.AddNitro()
.ModifyRequestOptions(o =>
{
o.PersistedOperations.OnlyAllowPersistedDocuments = true;
Expand All @@ -59,6 +61,8 @@ app.MapGraphQLPersistedOperations();
app.Run();
```

> **Note:** `AddDefaults()` is generated by a source generator in the `ChilliCream.Nitro` package. It requires the `ChilliCream.Nitro.Fusion` package to be referenced in your project. If `AddDefaults()` is not available, verify your package references or use the explicit `.AddFusion()` method instead. See the [Analyzers](/docs/nitro/analyzers) page for details.

`MapGraphQL()` is only registered in development. It exposes the standard GraphQL endpoint that client tooling needs: ad-hoc operations, introspection, and the schema endpoint at `/graphql/schema.graphql`. In production, only `MapGraphQLPersistedOperations()` is registered. The gateway exclusively accepts requests that reference a registered operation ID by URL, and the HTTP request parser skips reading the `query` field entirely.

# What the settings do
Expand Down Expand Up @@ -110,9 +114,10 @@ Use an HTTP request interceptor to allow ad-hoc operations in development while
```csharp
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddNitro().AddDefaults();

builder
.AddGraphQLGateway()
.AddNitro()
.AddHttpRequestInterceptor<DevToolsInterceptor>()
.ModifyRequestOptions(o =>
{
Expand Down Expand Up @@ -189,9 +194,10 @@ builder.Services

builder.Services.AddAuthorization();

builder.Services.AddNitro().AddDefaults();

builder
.AddGraphQLGateway()
.AddNitro()
.AddHttpRequestInterceptor<DevToolsInterceptor>()
.ModifyRequestOptions(o =>
{
Expand Down
111 changes: 10 additions & 101 deletions website/src/docs/fusion/v16/migration/migrate-from-15-to-16.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,19 +649,18 @@ The `watchFileForUpdates` parameter is gone — file watching is the default beh

### Nitro integration

Update all `ChilliCream.Nitro.*` packages to the same version as the `HotChocolate.Fusion.AspNetCore` package. If you're referencing any packages besides `ChilliCream.Nitro.Fusion` change the package references as shown below:
The packages have been restructured in v16. Versions now align with the rest of the platform, so you are migrating from `1.x` to `16.x`. For the full migration guide covering all package renames, API changes, and complete before/after examples, see [Migrating Nitro from 1 to 16](/docs/nitro/migration/migrate-from-1-to-16).

| Old | New |
| ------------------------------ | ------------------------------------------ |
| `ChilliCream.Nitro.Core` | `ChilliCream.Nitro.GraphQL` |
| `ChilliCream.Nitro` | `ChilliCream.Nitro.HotChocolate` |
| `ChilliCream.Nitro.Telemetry` | `ChilliCream.Nitro.OpenTelemetry` |
| `ChilliCream.Nitro.Azure.Core` | `ChilliCream.Nitro.Azure` |
| `ChilliCream.Nitro.*.Azure` | `ChilliCream.Nitro.Azure` (single package) |
The key changes for Fusion projects:

> Note: If you are self-hosting the Nitro backend, make sure to update it to the latest version as well. `10.1.0` is the minimum version required to work with the `ChilliCream.Nitro.*` packages.
- **Package rename:** `ChilliCream.Nitro.Core` becomes `ChilliCream.Nitro.GraphQL`, `ChilliCream.Nitro.Telemetry` becomes `ChilliCream.Nitro.OpenTelemetry`, and Azure packages are consolidated into `ChilliCream.Nitro.Azure`.
- **`ConfigureFromCloud()`** is replaced by `AddNitro().AddDefaults()` on the service collection.
- **Per-gateway feature options** are configured via `ModifyNitroOptions()` on the gateway builder.
- **`AddNitroExporter()`** is replaced by `AddOpenTelemetry()` on the `INitroBuilder`.
- **Asset cache** is now configured globally on `INitroBuilder` instead of per-gateway.
- **`AddDefaults()`** is a source-generated method that wires up the default integration when the correct packages are referenced.

v16 changes how Nitro is configured instead of the per gateway configuration `ConfigureFromCloud` call, you configure Nitro once on the service collection and then apply optional per gateway setting overrides.
> Note: If you are self-hosting the Nitro backend, make sure to update it to the latest version as well. `10.1.0` is the minimum version required to work with the `ChilliCream.Nitro.*` packages.

**Before**

Expand All @@ -686,101 +685,11 @@ builder.Services
o.ApiKey = "...";
o.Stage = "...";
})
.AddFusion();
.AddDefaults();

builder.Services.AddGraphQLGatewayServer();
```

Per gateway settings can be overridden via the `ModifyNitroOptions` API. There have also been some changes to the structure of options.

**Before**

```csharp
builder.Services
.AddFusionGatewayServer()
.ConfigureFromCloud(o =>
{
o.EnablePersistedQueries = true;
o.DefaultQueryCacheExpiration = TimeSpan.FromSeconds(30);
o.NotFoundQueryCacheExpiration = TimeSpan.FromSeconds(10);

o.LocalFusionConfigurationFile = "gateway.fgp";

o.Metrics.Enabled = true;
o.Metrics.ExportIntervalMilliseconds = 1000;
o.Metrics.ExportTimeoutMilliseconds = 400;

o.EnableOperationReporting = true;
});
```

**After**

```csharp
builder.Services
.AddGraphQLGatewayServer()
.ModifyNitroOptions(o =>
{
o.PersistedOperations.Enabled = true;
o.PersistedOperations.DefaultQueryCacheExpiration = TimeSpan.FromSeconds(30);
o.PersistedOperations.NotFoundQueryCacheExpiration = TimeSpan.FromSeconds(10);

o.LocalFusionConfigurationFile = "gateway.fgp";

o.Metrics.Enabled = true;
o.Metrics.ExportIntervalMilliseconds = 1000;
o.Metrics.ExportTimeoutMilliseconds = 400;

o.OperationReporting.Enabled = true;
});
```

If you were previously registering an asset cache you now do that on the `INitroBuilder` returned from `AddNitro()`:

**Before**

```csharp
builder.Services
.AddFusionGatewayServer()
.AddFileSystemAssetCache()
// or
.AddBlobStorageAssetCache()
// or
.AddAssetCache<CustomAssetCache>()
```

**After**

```csharp
builder.Services
.AddNitro()
.AddFusion()
.AddFileSystemAssetCache()
// or
.AddBlobStorageAssetCache()
// or
.AddAssetCache<CustomAssetCache>()
```

If you were previously hand-rolling the `ConfigureOpenTelemetry*Provider(...)` configuration with `AddNitroExporter()`, you can also switch to a new `AddOpenTelemetry()` API on the `INitroBuilder` that handles the registration for you.

**Before**

```csharp
services.ConfigureOpenTelemetryMeterProvider(x => x.AddNitroExporter());
services.ConfigureOpenTelemetryTracerProvider(x => x.AddNitroExporter());
services.ConfigureOpenTelemetryLoggerProvider(x => x.AddNitroExporter());
```

**After**

```csharp
services
.AddNitro()
// ...
.AddOpenTelemetry();
```

### Diagnostic listener API redesigned

Fusion diagnostics were redesigned in v16. The high-level `ExecuteFederatedQuery`, `ResolveError`, `ResolveByKeyBatchError`, `QueryPlanExecutionError`, and `SubgraphRequestError` hooks are gone. The new API is execution-stage specific.
Expand Down
10 changes: 7 additions & 3 deletions website/src/docs/hotchocolate/v16/guides/private-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@ First, add the `ChilliCream.Nitro` package to your project:

```bash
dotnet add package ChilliCream.Nitro
dotnet add package ChilliCream.Nitro.HotChocolate
```

Then configure the server:

```csharp
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddNitro();

builder
.AddGraphQL()
.AddQueryType<Query>()
.AddNitro()
.UsePersistedOperationPipeline()
Comment thread
PascalSenn marked this conversation as resolved.
Resolved
.ModifyRequestOptions(o =>
{
Expand Down Expand Up @@ -135,10 +137,11 @@ public class DevToolsInterceptor : DefaultHttpRequestInterceptor
Register the interceptor:

```csharp
builder.Services.AddNitro();

builder
.AddGraphQL()
.AddQueryType<Query>()
.AddNitro()
.AddHttpRequestInterceptor<DevToolsInterceptor>()
.UsePersistedOperationPipeline()
Comment thread
PascalSenn marked this conversation as resolved.
Resolved
.ModifyRequestOptions(o =>
Expand Down Expand Up @@ -169,12 +172,13 @@ builder.Services

builder.Services.AddAuthorization();

builder.Services.AddNitro();

builder
.AddGraphQL()
.AddQueryType<Query>()
.AddMutationType<Mutation>()
.AddAuthorization()
.AddNitro()
.AddHttpRequestInterceptor<DevToolsInterceptor>()
Comment thread
PascalSenn marked this conversation as resolved.
Resolved
.UsePersistedOperationPipeline()
.ModifyRequestOptions(o =>
Expand Down
Loading
Loading