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
4
votes
1 answer

Apollo GraphQL - Handling onConnect and OnDisconnect events

I'm developing a real-time chat app using Apollo GraphQL, and I want to keep the clients updated about the other client's status. Mean that I need to do something with the onConnect and OnDisconnect events from the subscriptions object (which…
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…
4
votes
0 answers

aws appsync subscriptions won't fire

I've been struggling with this for some time now, so I could use some help. I can't get onCreate subscription for type HealthPlan working in my react-native app. Based on Nader's example: schema.graphql type HealthPlan { id: ID! name:…
mnatan.brito
  • 883
  • 5
  • 18
  • 32
4
votes
1 answer

Jest: await vs setImmediate vs useFakeTimers vs new Promise(setImmediate)

What follows is a Jest test in TypeScript. I'm wondering why setImmediate() is required. The first example is a test that works. Next are various things I've tried that don't work. I'm not understanding the what is going on. The signature for…
Jeff Lowery
  • 2,492
  • 2
  • 32
  • 40
4
votes
1 answer

Subscription not working in React Native?

I need to integrate subscription in my ReactNative app. The subscription works fine on localhost in graphiql. I have deployed my backend on Heroku. I am using apollo-server and not hasura. My subscriptions are not working for the url given by Heroku…
4
votes
1 answer

GraphQLObjectType for subscriptions

I implemented a GraphQL server using Express, and I have an issue with the setup of GraphQL Subscription type. I'm developing a real time chat app and I'm trying to publish an event after a new message is created, but I don't understand how should I…
4
votes
1 answer

Configuring subscriptions with NEXT.js and Apollo client 2

I am trying to configure subscriptions with Apollo 2 and NEXT.js. I can get the client to connect to the server and they are working in the GraphQL playground, so the bad configuration must be in the withData file, or the component that handles the…
Tom
  • 2,543
  • 3
  • 21
  • 42
4
votes
1 answer

Subscribe to a List of Group / Private Chats in AWS AppSync

Im currently evaluating AWS AppSync as a backend solution for a messaging app. The users will have a view to explore new Chat Groups and a different view where they see a list of their joined and private Chats (In the list the name and the last…
Luca
  • 132
  • 1
  • 7
4
votes
1 answer

How to implement Subscriptions using Graphql SPQR?

How to implement Subscription feature of GraphQL using Graphql SPQR library?
4
votes
0 answers

Vue / Apollo: how to update on new subscription message?

I've been trying to get Vue + Apollo to work with my GraphQL server, it works like a charm except for the subscriptions part. I'm using apollo: { foo: { query: ..., subscribeToMore: { document: ..., updateQuery: (previous, {…
TommyF
  • 6,660
  • 8
  • 37
  • 61
4
votes
0 answers

Graphql-js subscriptions unit tests not working as expected

I have written integration tests for graphql-js subscriptions, which are showing weird behavior. My graphq-js subscription works perfectly in GraphiQL. But when the same subscriptions is called from unit test, it fails. Ggraphql-Js object, with…
M Atif
  • 109
  • 1
  • 9
4
votes
1 answer

Subscribe to one GraphQL item

Using GraphCool for my GraphQL backend, I would like to know how to subscribe to only a single item given the ID. I've been looking at the docs and trying to use filters, but I still can't figure it out. If I wanted to subscribe to all item…
Funk Soul Ninja
  • 2,113
  • 3
  • 17
  • 27
4
votes
1 answer

Example of Subscription class using Graphene and Python

I trying to figure out how to correctly define subscriptions in my schema using graphene-python. So far I have implemented queries and mutations, but how do you define a Subscription class? Below is what I was originally thinking: class…
3
votes
0 answers

How to use graphql subscriptions on large objects correctly with Apollo?

I am querying a large object with some relational fields (which are also relational sometimes). So I get a result like this: largeObject{ field1 field2 field3 children1{ field1 field2 ... and so on nestedChildren{ …
3
votes
0 answers

"Cant establish connection to the server" when trying to use websockets(Apollo GraphQL subscriptions) with Heroku

I've just finished up a React/Node.js/Apollo GraphQL/Postgres personal project. I've had minimal issues getting the app working on Heroku, and I'm able to make GraphQL queries and mutations without issue. However, when it comes to GraphQL…
Chris
  • 121
  • 6
1 2
3
18 19