Skip to content
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,39 @@ public class CustomRequestMiddleware
}
```

## OperationResultBuilder is now internal

If you've previously used the `OperationResultBuilder` to construct an `OperationResult`, switch to constructing it directly instead:

```csharp
var errors = ImmutableList.Create<IError>([]);
var extensions = ImmutableOrderedDictionary.Create([]);
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

ImmutableOrderedDictionary.Create([]) will not compile as written because the generic type arguments cannot be inferred from an empty collection expression. Use ImmutableOrderedDictionary<string, object?>.Empty or specify the generic arguments explicitly (e.g., Create<string, object?>(...)).

Suggested change
var extensions = ImmutableOrderedDictionary.Create([]);
var extensions = ImmutableOrderedDictionary<string, object?>.Empty;

Copilot uses AI. Check for mistakes.

context.Result = new OperationResult(errors, extensions);
```
Comment on lines +185 to +190
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The sample constructs an OperationResult with empty errors and empty extensions. In v16 OperationResult(ImmutableList<IError> errors, ...) throws when errors.Count == 0, and the other constructor also rejects having no data + no errors + no extensions. Update the snippet to show a valid construction (e.g., provide at least one error, or create the result with non-empty extensions, or include data).

Copilot uses AI. Check for mistakes.

If you've used `OperationResultBuilder.FromResult()` to alter an existing `OperationResult`, switch to directly modifying the `OperationResult`:

```diff
if (context.Result is OperationResult result)
{
- var resultBuilder = OperationResultBuilder.FromResult(result);
- resultBuilder.SetExtension("foo", "bar");
- context.Result = resultBuilder.Build();
+ result.Extensions = result.Extensions.SetItem("foo", "bar");
}
```

Most of the properties you'd want to modify are now immutable data structures that can be modified.
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

This sentence reads self-contradictory: “immutable data structures that can be modified.” Consider clarifying that these are immutable collections updated via non-destructive operations (e.g., SetItem returns a new instance) to avoid confusion for readers.

Suggested change
Most of the properties you'd want to modify are now immutable data structures that can be modified.
Most of the properties you'd want to change now expose immutable collection types; use their non-destructive update methods (for example, `SetItem` returns a new instance) and assign the returned value back to the property.

Copilot uses AI. Check for mistakes.

`OperationResultBuilder.CreateError(error)` can be simply replaced with `new OperationResult([error])`.

## OperationResult changes

We've removed the `IOperationResult` abstraction. If you've previously pattern-matched on this, you can simply replace it with `OperationResult`. To assert that an `IExecutionResult` is an `OperationResult` in tests, use `result.ExpectOperationResult();`.

We've also switched the `OperationResult.Errors` and `OperationResult.Extensions` properties to always be initialized instead of being nullable. If you were previously asserting these properties as `null` in tests, switch to asserting them as empty instead.

## Skip/include disallowed on root subscription fields

The `@skip` and `@include` directives are now disallowed on root subscription fields, as specified in the RFC: [Prevent @skip and @include on root subscription selection set](https://github.com/graphql/graphql-spec/pull/860).
Expand Down Expand Up @@ -338,6 +371,10 @@ Note that this option is likely to be removed in a later release, so it's recomm

The `DateTime` scalar now serializes with up to 7 fractional seconds (`FFFFFFF`) as opposed to exactly 3 (`fff`).

## IHasRuntimeType is now IRuntimeTypeProvider

In an effort to standardize our abstractions, we've renamed `IHasRuntimeType` to `IRuntimeTypeProvider`.

# Deprecations

Things that will continue to function this release, but we encourage you to move away from.
Expand Down