Tag: websocket
-
How do I use web socket inside a graphql mutation using socket.io and expressGraphQL?
0 `I have been trying to emit an event to a specific user using socket.io when a specific mutation is called I tried to use this on my main server file: const graphqlMiddleware = expressGraphQL((req, res) => ({ schema, graphiql: __DEV__, rootValue: { request: req, response: res, }, pretty: __DEV__, })); app.use("/graphql", graphqlMiddleware); let server…
-
websocket subscription server not working. unable to reach subscription server graphql-ws ws
2 i follow the [same documentation code][1] for creating subscription server using websocket graphql, put it doesn’t work with graphql-ws and ws the code worked when i removed the serverCleanup definition, and it also woks well for older subscription library "subscription-transport-ws" my index.js const { ApolloServer } = require(‘apollo-server-express’) const { ApolloServerPluginDrainHttpServer } = require(‘apollo-server-core’)…
-
How client sends close signal to graphql subscription server?
0 I’m working on a graphql server and there is one subscription API. This is the starter code I found on gqlgen documentation: // CurrentTime is the resolver for the currentTime field. func (r *subscriptionResolver) CurrentTime(ctx context.Context) (<-chan *model.Time, error) { // First you’ll need to `make()` your channel. Use your type here! ch :=…
-
apollo explorer say “isTrusted”: true when i try use Subscription
3 guys, I have a problem when I want to use a Subscription I’m facing this issue I don’t find a solution in any place, I’m a GQL user and i decide to use Subscription to make real-time website but I’m facing a a this issue , hare is code I’m trying to show apollo…
-
How to close the websocket in graphql config flutter?
1 class GraphqlConfig { final serverLink = Link.split( (request) => request.isSubscription, WebSocketLink( "mylink" ), HttpLink("mylink", defaultHeaders: <String, String>{ })); initClient() { ValueNotifier<GraphQLClient> client = ValueNotifier( GraphQLClient( link: serverLink, cache: GraphQLCache(), ), ); return client; } GraphQLClient clientToQuery() { return GraphQLClient( cache: GraphQLCache(), link: serverLink, ); } } I got the following exception DOMException: Failed to…
-
Spring cloud gateway: Websockets on the same URL as HTTP(S)
1 I’m using Spring Cloud Gateway with a routing configuration like this: spring: cloud: gateway: routes: – id: http uri: https://kubernetes-ingres-controller In other words, I’m sending all paths onwards to somewhere else, which happens to be a K8s ingress controller. Spring adds some headers and handles the translation of session cookies into bearer tokens. I’m…
-
How to retry a Spring WebSocketGraphQlClient query
0 Using Spring Boot 3.2.4 with Spring WebFlux/GraphQL subscription via Websocket. Server A exposes a graphqlSubscription, and Server B consumes the subscription. They both use the same components (reactor/netty). Steps to Reproduce: // Client side, Initialize the webSocketGraphQlClient ReactorNettyWebSocketClient reactorNettyWebSocketClient = new ReactorNettyWebSocketClient(HttpClient.create(), build); WebSocketGraphQlClient.builder(serverUrl, reactorNettyWebSocketClient).build(); // Call sample webSocketGraphQlClient .document(query) .retrieveSubscription(path) .toEntity(XXXX.class) .retryWhen(Retry.fixedDelay(5, Duration.ofMinutes(1))).blockLast()…
-
How to handle security (authn/authz) with DGS Subscriptions and spring security?
0 I’m mirroring a question asked directly on GitHub here. I’m up to the point where if I authorize("/subscriptions",permitAll) while configuring my SecurityWebFilterChain then I can successfully use my subscription queries. However, that removes all the security. I would have liked to do: authorize("/subscriptions",hasAuthority("access")) Anyway, now I need to make sur that the user is…
-
Closing all WebSocket sessions using Spring GraphQL
0 I’m working on a Spring GraphQL (newest spring-boot-starter-graphql) project and I’m using WebSocket to establish subscriptions. However, I’m having trouble finding a way to close all WebSocket sessions programmatically. I’ve looked into the documentation and searched for examples, but I couldn’t find a clear solution specific to Spring GraphQL. Most of the resources I…
-
GraphQL: Subscriptions vs periodic querying to be up to date without refresh?
2 The bounty expires in 20 hours. Answers to this question are eligible for a +50 reputation bounty. Tony Ngomana is looking for an answer from a reputable source. Imagine that we want to serve a web application to thousands of users. The information on the page should stay up to date even if the…