Questions tagged [graphql-subscriptions]

GraphQL subscriptions are a way to push data from the server to the clients that choose to listen to real time messages from the server.

In addition to fetching data using queries and modifying data using mutations, the GraphQL spec supports a third operation type, called subscription.

Subscriptions in GraphQL and Relay

Subscriptions in GraphQL and Apollo

280 questions
1
vote
1 answer

Graphql subscription in playground during local development throwing "Could not connect to websocket endpoint" in basic nestjs project

This is happening on a simple project during local development, so cloud infrastructure isn't an issue. This is also happening in the application playground. My module registration: GraphQLModule.forRootAsync({ driver:…
SebastianG
  • 8,563
  • 8
  • 47
  • 111
1
vote
0 answers

Why my NextJs does not work with Graphql Apollo Subscription?

I am making a chat application in NextJS using a Graphql subscription. I tried to find some examples but all I found were either expressjs with reactjs or expressjs with nextjs. I used graphql-yoga in nextjs serverless and graphql apollo in…
1
vote
1 answer

Unable to establish a websocket connection for GraphQL subscription

I am trying to implement a GraphQL WebSocket-based @subscription on a server (using NestJS @subscription). The server is hosted on an AWS ECS and is behind an ALB. We currently have an AWS API GW connection via VPC-link to our ALB. I tried to build…
1
vote
1 answer

Web socket connection fails for Node.js graphql api

So I need the Subscription mechanism for a GraphQL API that I've done for some server side notifications. For the config of API apollo-server-express was used. Here is the config file: dotenv.config(); const PORT = process.env.PORT; const app =…
1
vote
0 answers

GraphQL Subscriptions not working on Firefox - Error 400 bad Request

I have a Frontend app that is built in React and it is connected to a GraphQL backend using Apollo Client. Queries and Mutations are working fine in all browsers, but I have an issue with the Subscriptions. On Google Chrome and Safari are working…
1
vote
0 answers

Why GraphQL subscription clients uses websocket instead of SSE?

GraphQL clients like Relay or Apollo both use websocket over SSE to support subscription. What's the reason behind this?
injoy
  • 3,993
  • 10
  • 40
  • 69
1
vote
3 answers

GraphQl federation server that supports subscriptions

I'm currently evaluating different GraphQl servers in order to find one that supports subscriptions on a federated schema. Apollo and HotChocolate don't support that. HotChocolate is going to (its on the roadmap) but I can't wait; and Apollo wants…
Master Azazel
  • 612
  • 1
  • 12
  • 32
1
vote
0 answers

Create a good k6 load test with graphql/subscription

After struggling against k6, with the help of the answers to my other question, i was able (i think) to test subscriptions with websocket. Now i'm trying to desing a good test. Our app is a Single Page App that mainly uses websocket subscriptions…
1
vote
1 answer

get notification from hasura to an angular application

Can you suggest me some guidelines to build an architecture to get notification from a hasura server to an angular application? my use case is sumple: i insert a document on hasura, the angular client should be notified by in icon on the…
pinale
  • 2,060
  • 6
  • 38
  • 72
1
vote
1 answer

How to implement auth guard for graphql subscriptions (passportjs + cookies)

How I can pass user to the request? Is there any possible way to implement something like SubscriptionAuthGuard? without the subscription, everything works fine Code: GraphQLModule.forRoot({ installSubscriptionHandlers: true, …
1
vote
1 answer

Why am I not getting updates from my subscription?

I am trying to set up GraphQL Subscriptions but it seems to get connected to the backend but it's not pushing any updates. On frontend, I am using Nuxt 2 and that's how I am trying to get it working: That's my test query export const…
user16373392
1
vote
0 answers

How to get GraphQL schema of a subscription from Spring Boot backend in AWS Elastic Beanstalk

For testing, I added Playground into the project. In http://localhost:5000/playground case, everything is OK and connected to the Spring Boot backend and listening to notifications Now, in Elastic Beanstalk, I cannot fetch subscription schema.…
1
vote
0 answers

Best practises for server events with ApolloGraphql

My team and I are running a Apolloserver for our app and we have a feature request that requires us to use subscriptions or SSE. In short we need to intercept orders from multiple clients and send them as print requests to a client that is connected…
1
vote
0 answers

How to close the websocket in graphql config flutter?

class GraphqlConfig { final serverLink = Link.split( (request) => request.isSubscription, WebSocketLink( "mylink" ), HttpLink("mylink", defaultHeaders: { })); …
1
vote
0 answers

NextJs GraphQL Subscription: How to set up connect api with Apolo

I currently start a project that needs integrate GraphQL subscription with NextJs from client side. So this is the way I set up client for graphQL subscription Here is with I have done: client.js import { ApolloClient, ApolloLink, …
Tâm Đỗ
  • 89
  • 1
  • 5