Skip to content

Commit 8104dce

Browse files
authored
Move IOperationMessagePayload section from website-next to website (#9732)
1 parent e171f47 commit 8104dce

2 files changed

Lines changed: 30 additions & 30 deletions

File tree

website-next/content/docs/hotchocolate/migrating/migrate-from-15-to-16.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,36 +1108,6 @@ We removed the following methods from the `IExecutionDiagnosticEventListener` si
11081108

11091109
Some other methods also had a change in their signature - simply override them again to fix any compilation issues.
11101110

1111-
## IOperationMessagePayload exposes raw JSON
1112-
1113-
The `IOperationMessagePayload` interface, used by `ISocketSessionInterceptor` hooks (`OnConnectAsync`, `OnPingAsync`, `OnPongAsync`), no longer exposes the `As<T>()` deserialization helper. It now provides direct access to the raw `JsonElement?` through a `Payload` property:
1114-
1115-
```diff
1116-
-public interface IOperationMessagePayload
1117-
-{
1118-
- T? As<T>() where T : class;
1119-
-}
1120-
+public interface IOperationMessagePayload
1121-
+{
1122-
+ JsonElement? Payload { get; }
1123-
+}
1124-
```
1125-
1126-
If you were calling `.As<T>()` to deserialize the payload, switch to `Payload?.Deserialize<T>()`:
1127-
1128-
```diff
1129-
public override ValueTask<ConnectionStatus> OnConnectAsync(
1130-
ISocketSession session,
1131-
IOperationMessagePayload connectionInitMessage,
1132-
CancellationToken cancellationToken = default)
1133-
{
1134-
- var payload = connectionInitMessage.As<MyConnectPayload>();
1135-
+ var payload = connectionInitMessage.Payload?.Deserialize<MyConnectPayload>();
1136-
1137-
// ...
1138-
}
1139-
```
1140-
11411111
## Experimental @semanticNonNull support removed
11421112

11431113
Hot Chocolate v15 included experimental support for the `@semanticNonNull` directive, which let you mark fields as semantically non-null while still returning `null` (rather than propagating to the parent) when a resolver errored. We've removed this feature in v16 in favor of the [`onError` proposal](https://github.com/graphql/graphql-spec/pull/1163).

website/src/docs/hotchocolate/v16/migrating/migrate-from-15-to-16.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,36 @@ We removed the following methods from the `IExecutionDiagnosticEventListener` si
10861086

10871087
Some other methods also had a change in their signature - simply override them again to fix any compilation issues.
10881088

1089+
## IOperationMessagePayload exposes raw JSON
1090+
1091+
The `IOperationMessagePayload` interface, used by `ISocketSessionInterceptor` hooks (`OnConnectAsync`, `OnPingAsync`, `OnPongAsync`), no longer exposes the `As<T>()` deserialization helper. It now provides direct access to the raw `JsonElement?` through a `Payload` property:
1092+
1093+
```diff
1094+
-public interface IOperationMessagePayload
1095+
-{
1096+
- T? As<T>() where T : class;
1097+
-}
1098+
+public interface IOperationMessagePayload
1099+
+{
1100+
+ JsonElement? Payload { get; }
1101+
+}
1102+
```
1103+
1104+
If you were calling `.As<T>()` to deserialize the payload, switch to `Payload?.Deserialize<T>()`:
1105+
1106+
```diff
1107+
public override ValueTask<ConnectionStatus> OnConnectAsync(
1108+
ISocketSession session,
1109+
IOperationMessagePayload connectionInitMessage,
1110+
CancellationToken cancellationToken = default)
1111+
{
1112+
- var payload = connectionInitMessage.As<MyConnectPayload>();
1113+
+ var payload = connectionInitMessage.Payload?.Deserialize<MyConnectPayload>();
1114+
1115+
// ...
1116+
}
1117+
```
1118+
10891119
## Experimental @semanticNonNull support removed
10901120

10911121
Hot Chocolate v15 included experimental support for the `@semanticNonNull` directive, which let you mark fields as semantically non-null while still returning `null` (rather than propagating to the parent) when a resolver errored. We've removed this feature in v16 in favor of the [`onError` proposal](https://github.com/graphql/graphql-spec/pull/1163).

0 commit comments

Comments
 (0)