Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples on subscription provider config (AddInMemorySubscriptions and AddRedisSubscriptions extension methods) #5751

Merged
merged 2 commits into from
Feb 2, 2023
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 @@ -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
Expand All @@ -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.
Expand Down