From 757f84a82f06c1701dd477e35c74f16050f35acd Mon Sep 17 00:00:00 2001 From: vajsm Date: Thu, 2 Feb 2023 23:32:19 +0100 Subject: [PATCH] Updated examples on subscription provider. --- .../hotchocolate/v13/defining-a-schema/subscriptions.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/website/src/docs/hotchocolate/v13/defining-a-schema/subscriptions.md b/website/src/docs/hotchocolate/v13/defining-a-schema/subscriptions.md index b5e2387015c..0d115097234 100644 --- a/website/src/docs/hotchocolate/v13/defining-a-schema/subscriptions.md +++ b/website/src/docs/hotchocolate/v13/defining-a-schema/subscriptions.md @@ -164,7 +164,9 @@ To make pub/sub work, we also have to register a subscription provider. A subscr The In-Memory subscription provider does not need any configuration and is easily setup. ```csharp -services.AddInMemorySubscriptions(); +services + .AddGraphQLServer() + .AddInMemorySubscriptions(); ``` ## Redis Provider @@ -178,8 +180,9 @@ In order to use the Redis provider we have to add the `HotChocolate.Subscription After we have added the package we can setup the Redis subscription provider. ```csharp -services.AddRedisSubscriptions((sp) => - ConnectionMultiplexer.Connect("host:port")); +services + .AddGraphQLServer() + .AddRedisSubscriptions((sp) => ConnectionMultiplexer.Connect("host:port")); ``` Our Redis subscription provider uses the [StackExchange.Redis](https://github.com/StackExchange/StackExchange.Redis) Redis client underneath.