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
2 answers

Apollo Server Subscriptions not working

I've made a GraphQL backend using Apollo Server, Sequelize (for the ORM), MySQL (DB) and Express (Web Server). I have also added subscriptions, which the problem is there. I can't even reach the WS endpoint using a websocket tester. Can someone…
shabenda
  • 1,759
  • 3
  • 14
  • 23
1
vote
0 answers

Apollo-Angular with Subscription: template not picking up the changes from the subscription

I am using apollo-angular + subscriptions-transport-ws in my project. I have the client setup to listen to the subscription for user's password updated or new user is created event. This is how it is setup //Apollo…
Anthony C
  • 2,117
  • 2
  • 15
  • 26
1
vote
1 answer

Unhandled GraphQL Subscription error

I am using apollo client with the additional module subscriptions-transport-ws and graphql on the server. When a graphql error happens on the server, kind of cannot return null for non-nullable... the Browser tells me that there is a apollo has a…
Locco0_0
  • 3,420
  • 5
  • 30
  • 42
1
vote
1 answer

GraphQL subscriptions: Error on calling apolloClient.subscribe

I think I have the backend subscription setup correctly. I am using angular on the client side, when I try to call subscribe I got an error passwordUpdatedSubscription = gql` subscription passwordUpdated{passwordUpdated{name password}} `; // Apollo…
Anthony C
  • 2,117
  • 2
  • 15
  • 26
0
votes
0 answers

NestJS Graphql subscription -- how to disconnect client?

I've been looking like mad trying to find some API documentation on how to do this. I'm using 9x versions of nestjs with graphql-ws 5.11.2 and graphql-redis-subscriptions 2.5.0 and 16.5.0 graphql. I'm doing the code first approach which has this…
SebastianG
  • 8,563
  • 8
  • 47
  • 111
0
votes
0 answers

Flutter Subscription Graphql: UnsupportedOperation, unknown not supported through the realtime channel

I am creating a subscription with GraphQL, and I need to consume that subscription with Flutter, I can connect to the ws and get the basic data, but seems my code still not working coz got the error, here's the…
R Rifa Fauzi Komara
  • 1,915
  • 6
  • 27
  • 54
0
votes
0 answers

how to test the GraphQL subscription with flutter

I have this endpoint for graphql api: http://localhost:2000/graphql when I try this on the playground, its works: mutation { createMessage(messageInput: {text: "noti", username: "osama alatraqchi"}) { text, createdBy } } and run…
0
votes
0 answers

pass pubsub into context in graphql subscription

I'm struggling with this all day long, I want to implement subscriptions feature on my mongodb-express-graphql-nextjs project. I can't use context.pubsub in resolver. Am I missing something? please save me! Problem Cannot use pubsub in subscription…
ton1
  • 7,238
  • 18
  • 71
  • 126
0
votes
0 answers

Make nestjs server subscribe to another nestjs server using graphql subscriptions

In the graphql server, i use this code to setup: app.module.ts GraphQLModule.forRoot({ playground: true, typePaths: ['./**/*.graphql'], driver: ApolloDriver, installSubscriptionHandlers: true, subscriptions: { …
0
votes
0 answers

Integrating WebSockets for GraphQL subscriptions in SvelteKit application with Apollo Server and Neo4j GraphQL Library

I'm trying to integrate GraphQL subscriptions in my SvelteKit application using Apollo Server and the Neo4j GraphQL Library. I have successfully set up the basic GraphQL queries and mutations, but I'm struggling with implementing…
0
votes
0 answers

How can I write a mock for GraphQL subscriptions/websockets using CodeceptJS?

if we have http reqest we write mock like this this.mockRoute( 'https://*', (route) => { route.fulfill({ status: 200, json: jsonMock }) } ) i whould like to…
0
votes
1 answer

Hasura Subscriptions are not working in ngx-admin

Configuring Apollo to connect to Hasura and trying to setup a GraphQL subscription does not work. No errors or anything else, just does not work. I have created a simple Angular project (call it Base Demo) and configured Apollo and the subscriptions…
gbos
  • 503
  • 2
  • 6
  • 28
0
votes
0 answers

What advantages do GraphQL Subscriptions offer over NestJS Gateway for pushing server-to-client events using 'ws'?

Why do we need GraphQL Subscriptions instead of NestJS Gateway both using ws? What's the difference in between the two in achieving the common goal i.e. Pushing events from Server to Client I've tried finding the answer but haven't been able to…
0
votes
1 answer

graphql-ws createClient throws WebSocket implementation missing

I have a nextjs(client side) project, I followed this to subscribe to my graphql subscription but I got "WebSocket implementation missing; on Node you can import WebSocket from 'ws'; and pass webSocketImpl: WebSocket to createClient" , it seems to…
0
votes
1 answer

How to fix "Firefox can’t establish a connection to the server at wss://example.domain/subscription" issue?

This is how I have setup app.js: /** * Importing Packages */ require("dotenv").config({ path: `./env/.env-${process.env.NODE_ENV}` }); const express = require("express"); const logger …
Saswat
  • 12,320
  • 16
  • 77
  • 156