Comments (4)
Hi,
To close the websocket connection you need to dispose the whole GraphQLHttpClient
instance.
Whats your use case?
from graphql-client.
Hello,
I have a web application with hundreds of users. For each user I create several subscriptions to graphql server. If the user wants, he can manually unsubscribe some. Despite calling .Dispose(), the connection remains and due to the limit of open connections on the server I want to close it.
I need to maintain and manage these connections on the server side and not on the client side, so this is how it is handled.
Thank you,
Zdenek
from graphql-client.
A single instance of GraphQLHttpClient
only opens and maintains 1 websocket connection, which is used for all subscriptions created on it. So reducing the number of subscriptions to the same server in a web app instance won't reduce the number of websocket connections to the server (still 1 per active instance).
If you have more than one, please make sure there is just one instance of GraphQLHttpClient
in your app (i.e. registered as singleton in DI), that is how its meant to be used.
from graphql-client.
Many thanks, i will try.
from graphql-client.
Related Issues (20)
- MapConverter throws if extensions property is null
- .NET 8.0 Issue w/ SystemTextJsonSerializer HOT 1
- SendQueryAsync fails unless Uri has a trailing '/' HOT 1
- GraphQL.Client.Example fails with exception
- first and take not working properly? HOT 2
- How to use Polly with this library? HOT 1
- AppSync's WS connection closing at initialization HOT 1
- Json Serialiser doesn't handle structs well and ignores type converters HOT 11
- Make it easier to use GraphQL’s constructor with HttpClient and only endpoint
- System.Text.Json.JsonException when parsing response from SendMutationAsync. HOT 1
- Please consider adding [StringSyntax("GraphQL")] attributes HOT 4
- Unused project reference to Newtonsoft.Json in GraphQL.Client.LocalExecution
- Cannot set content-type header in initial request establishing a GraphQL websocket connection HOT 6
- Variable parsing different between C# "GraphQLRequest" and json/webui HOT 6
- More samples please + Does this library support graphql-sse (server-sent events)? HOT 5
- WebSocket handler in GRAPHQL_TRANSPORT_WS protocol should not send GQL_COMPLETE when closing connection HOT 1
- How to add header in graphql response
- The HTTP request failed with status code OK HOT 1
- How to pass a list of "input Type" in variables HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-client.