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

Apollo Subscription doesn't seem to get called on Mutation

New to Apollo, so I decided to take the most simple example I found and try to work it in a slightly different way. My code can be found here. The problem I am having is that the Subscription doesn't seem to get called when I call the Mutation…
CodeChimp
  • 8,016
  • 5
  • 41
  • 79
2
votes
1 answer

Why is my graphql Context returning an empty object

I have built graphql apollo (v4) server by following the docs. I just made the subscription and pubsub work. However, when I was trying to work on authentication, I realized that my graphql server does not provide context to my resolvers as…
2
votes
0 answers

Response time for graphql subscriptions

What we have Tech stack: React, AWS Amplify, Graphql..... We are developing an application which is using graphql subscriptions to get real-time data with AWS Amplify. What we want Main requirement is to let user know if there is low network…
targhs
  • 1,477
  • 2
  • 16
  • 29
2
votes
1 answer

GraphQL Subscriptions is null using Express-GraphQL and graphql-subscriptions

I am using TypeScript and have Server and Client application. Below is the server code. Server Code import express, { Express } from "express"; import { graphqlHTTP } from "express-graphql"; import { buildSchema } from "type-graphql"; import {…
Aqdas
  • 868
  • 4
  • 16
  • 57
2
votes
0 answers

Handle unsubscribe GraphQL subscription

I have an issue with subscription can't be unsubscribe. Before we start, this is my setup: Apollo Client(graphql-ws) <-> Apollo Server(graphql-ws). On the server, I build a custom PubSub instead of using the one provided. As you can see here, the…
2
votes
0 answers

Fetching only what is needed vs Offline First (RTK Query, GraphQL, React Native)

How would you combine / solve the two diverging approaches of: rtk query / graphql advising to only fetch what is needed on that screen offline first capability in a react native app? Basically apollo and also rtk-query advise for small queries…
uloco
  • 2,283
  • 4
  • 22
  • 37
2
votes
0 answers

How to write a simple unit test for GraphQL Subscription over websocket?

My backend is a webflux server using the graphql-java-kickstart (v11.0.0) library and I have a bunch of graphql http requests right now. I'm using Spring's WebTestClient to test my graphql Queries and Mutations. Basically, I'll just call it and…
kane
  • 5,465
  • 6
  • 44
  • 72
2
votes
0 answers

Spring GraphQL subscription publish dynamically

I am new to Reactive programming and Spring GraphQL subscription. I want to make my App 1 publish resultSet from JPA findAll() method through Flux and my client listen to it continuously. I want Flux publish-on-demand (e.g. when a message comes from…
Shido
  • 21
  • 2
2
votes
0 answers

apollo explorer say "isTrusted": true when i try use Subscription

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…
2
votes
1 answer

Apollo v3 GraphQL Subscription Error: Must provide document

I'm testing out subscription on Apollo v3 using the example setup on the docs. But I get the above error. I'm not sure what I'm missing. Here's the complete reproducible code on Github gist const typeDefs = gql` type Subscription { …
2
votes
1 answer

How to filter Subscription events based on some object's id?

I would like to be able to filter subscriptions for some operation based on objects id. For example I would like to do something like this: subscription{ onTaskCompleted(taskId: "1"){ taskCompleted{ status items{ reason …
O.MeeKoh
  • 1,976
  • 3
  • 24
  • 53
2
votes
2 answers

ApolloServer: "Could not connect to websocket endpoint ws://localhost:4000/subscriptions. Please check if the endpoint url is correct."

I can't implement any subscriptions because it suddenly disconnects from it when I try to listen to some endpoint with GraphQL Playground: {"error": "Could not connect to websocket endpoint wss://localhost:4000/graphql. Please check if the endpoint…
2
votes
0 answers

Persistent Query Support in GraphQL Java

I am new to GraphQl. I would like to implement the Persistent query support for my API. I want to know whether we can achieve it using GraphQL Java. We are not using apolo or any other third party libraries. Would like to know , how can i implement…
2
votes
2 answers

Can't get a simple broadcast with graphql-ruby subscriptions working

I have a barebones setup for update broadcasts with graphql-ruby over Action Cable. The client receives the initial payload on subscription fine. The client isn't receiving any updates and the update method of the subscription type isn't being…
Ates Goral
  • 137,716
  • 26
  • 137
  • 190
2
votes
2 answers

graphql subscription Could not connect to websocket endpoint at elastic beanstalk

I have graphql-yoga(GraphQL server) application running on Elastic Beanstalk with Application Load Balancer. I am able to do Query and Mutation. But when I tried Subscription using GraphQL playground it does not connect with the below…