graphql-dotnet / graphql-dotnet/graphql-client
Configure connection init payload per socket subscription request.
- Dominant language
- C#
- Stars
- 648
- Forks
- 136
- PR merge metrics
- No merged PRs in 30d
Description
I have a multi tenant app, and I need to pass through a token per subscription.
Currently I am using the ConfigureWebSocketConnectionInitPayload, that sends the appropriate token I require.
But this is variable is set per grapqhl connection, is there a way to sett this per CreateSubscriptionStream request?
or do I need to have some kind of singleton subscription factory.
```
GraphQLRequest graphQLRequest = ...
graphQlClient.Options.ConfigureWebSocketConnectionInitPayload = (GraphQLHttpClientOptions x) => { return new Dictionary() {
["token"] = "token value"
}; };
return graphQlClient.CreateSubscriptionStream(graphQLRequest);
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.