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

230 questions
26
votes
2 answers

Stitching secure subscriptions using makeRemoteExecutableSchema

We have implemented schema stitching where GraphQL server fetches schema from two remote servers and stitches them together. Everything was working fine when we were only working with Query and Mutations, but now we have a use-case where we even…
10
votes
3 answers

Serverless GraphQL Subscriptions

I recently started working with GraphQL and have been able to successful set it up on AWS Lambda giving me a "serverless" architecture. However I would like to utilize GraphQL Subscriptions for more realtime functionality. I understand that AWS…
10
votes
3 answers

GraphQL Subscriptions: Max Listeners Exceeded Warning

We are using GraphQL Subscriptions and pubsub to subscribe to posts. When more than 10 subscriptions occur we get the the node warning "MaxListenersExceededWarning: Possible EventEmitter memory leak detected." Is it possible to raise the max…
Locco0_0
  • 2,768
  • 5
  • 24
  • 32
9
votes
0 answers

How to trigger GraphQL Subscriptions from a backend message queue application

Currently I'm using Socket.io / SignalR to emit an event from my backend message queue system, whenever new data is incoming. That way I can setup an event handler in my React application and update the relay cache from within the event handler. It…
Dac0d3r
  • 1,761
  • 3
  • 33
  • 57
9
votes
1 answer

Subscription not connecting using ApolloServer

I am trying to get a subscription up and running with ApolloServer (v 2.2.2). I had a setup that all-of-a-sudden just stopped working. When I try to connect to the subscription in graphiql/PlaygroundI get the error: { "error": "Could not connect…
Max Gordon
  • 4,888
  • 1
  • 37
  • 63
8
votes
2 answers

GraphQL: How nested to make schema?

This past year I converted an application to use Graphql. Its been great so far, during the conversion I essentially ported all my services that backed my REST endpoints to back grapqhl queries and mutations. The app is working well but would like…
sauce
  • 572
  • 3
  • 8
  • 22
8
votes
1 answer

AWS AppSync Authorization

I'm planning to use AWS Appsync to migrate a graphQL endpoint in a lambda function, which is being triggered by a POST via the API Gateway. I'm looking into AppSync mainly because of the subscriptions, which I can't create using a Lambda…
7
votes
1 answer

Uncaught TypeError: Can't add property 12, object is not extensible

I can't seem to understand the error I am getting on my client application. I am subscribing to a graphql subscription and I am able to retrieve the updates but I am not being able to push the changes to the typescript array called…
6
votes
1 answer

How to use GraphQL subscription correctly?

I have a GraphQL powered app. The query and mutation parts work well. I try to add GraphQL subscription. The server GraphQL subscription part code is inspired by the demo in the readme of apollographql/subscriptions-transport-ws. Please also check…
Hongbo Miao
  • 31,551
  • 46
  • 124
  • 206
6
votes
1 answer

React Apollo first object from subscription not being merge into previous data it actually gets removed

I have a query which gets me a list of notes and a subscription which listens and inserts new notes by altering the query. However the problem is the first note doesn't get added. So let me add more detail, initially the query response with an…
Jake Lacey
  • 553
  • 4
  • 20
5
votes
0 answers

How can I handle disconnect event using graphql-subscriptions

I am using graphql-subscriptions to manage session (rooms). I have simple application like "chat". I can send message to chat using: import { PubSub } from 'graphql-subscriptions'; ... pubSub.publish(triggerName, payload) I can listen to…
ciyada8549
  • 51
  • 2
5
votes
2 answers

Apollo Subscriptions: Apollo Graphql is receiving updates on Playground but not on client

I'm using react on Apollo GraphQL subscriptions and I can receive updates on Apollo Playground but not on Client. Here is the response on the Apollo Playground: Graphql Server is on http://localhost:4000/ and subscriptions on…
Ilyas karim
  • 3,383
  • 3
  • 26
  • 40
5
votes
0 answers

React Apollo - subscribeToMore / updateQuery updates propagating erroneously

A strange scenario with GraphQL. Let's say there is a Subscription called postIsRead, which signifies a post in a list of posts as currently being read, such as: Post: { id: 1, read: true } Only one post can be read at once. When a user clicks…
5
votes
1 answer

How to use subscriptions-transport-ws with passport and express-session

I'm using a passport local strategy that works well with express: passport.use(localStrategy); passport.serializeUser((user, done) => done(null, JSON.stringify(user))); passport.deserializeUser((obj, done) => done(null,…
4
votes
2 answers

How to trigger subscriptions in type-graphql?

I have a project set up with Apollo Server with express. I have been trying to set up subscriptions but it is just not happening. I have followed all the steps as per the following link : https://typegraphql.com/docs/subscriptions.html Further, I…
1
2 3
15 16