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 to internal service through public gateway service

I have an "internal" service and a public facing API gateway service. I want to implement a graphql subscription so that clients can receive asynchronous real time updates from the internal service, but only the public service is exposed. I have…
ryan0
  • 1,482
  • 16
  • 21
1
vote
1 answer

Add subscription to specific route in apollo client GraphQL React app

I'm looking for a solution where I can add the subscription to a specific route instead of binding the subscription globally when the app start. I know the subscription can be acheived with following code const wsLink = new WebSocketLink({ uri:…
Harsh Makadia
  • 3,263
  • 5
  • 30
  • 42
1
vote
1 answer

Apollo GraphQL - Associated types not included on Subscription response

Let's say I have a Post and Comment model. A Post hasMany Comments. In React Apollo I'm using subscribeToMore on a Query for a particular post. The query appears as follows: query getPost(id: ID!){ id, title, comments { id } } And the…
1
vote
1 answer

Apollo GraphQL unsubscribe seems to be broken

We are using Apollo GraphQL with subscriptions (via websockets) in a node.js backend and a react frontend. The app provides a list of devices. When a user clicks on one device he gets the monitoring data for the device with live updates (from the…
Woozar
  • 1,000
  • 2
  • 11
  • 35
1
vote
0 answers

Can't figure out proper configuration for Next.js, uploads and subscriptions with Apollo/GraphQL-Yoga

Pardon my newbie question here but I'm having a ton of difficulty getting this to work corrrectly. I'm having a hard time getting subscriptions to behave properly with Next.js, Apollo and GraphQL-Yoga. I've tried searching everywhere for answers and…
1
vote
2 answers

laravel-graphql-playground can't connect to websocket in UI when using subscribe

I'm currently using Lighthouse as the graphql server for laravel. I've worked through the subscription documentation (https://lighthouse-php.com/master/subscriptions/getting-started.html) on their site, as well as added the appropriate pusher…
1
vote
0 answers

Graphql subscription is not working properly

I'm working on real time personal room chat application using graphql subscription node server with react client. When I tried to chat with two to three chat rooms continuously it doesn't respond . When I refreshing the page it works fine and…
Shenba
  • 11
  • 4
1
vote
0 answers

graphql subscriptions with child nodes seems not working for me

First of all, Subscriptions is working if I have next code structure schema type Subscription { somethingChanged: IResult } type IResult { id: String! } resolvers export const resolvers = { Query: { }, Mutation: { }, …
Yuriy Gyerts
  • 1,464
  • 18
  • 30
1
vote
1 answer

How can I implement apollographql client into the maven project to activate subscription?

I am trying to create a graphql client in Java project and I am using apollographql library. The problem is that I am not able to get the dependencies using the pom.xml with version different than from Central repository. The other thing is that all…
1
vote
1 answer

Graphql | Apollo client | How to change variables in existing subscription?

I have setup a Apollo Server and Client with Subscriptions. Everything works as expected in basic setup. I am using Apollo Client's Subscribe method for subscription. Something like below: graphqlClient.subscribe({ query, variables…
1
vote
2 answers

Looking for code for a server side GraphQL subscription listener

I have been looking high and low for some code that will allow me to register to a GraphQL subscription on the server side and read messages, coming from the external subscription server on the server side. I can get my server-side subscription…
reselbob
  • 365
  • 3
  • 13
1
vote
1 answer

Graphql subscriptions in a distributed system with Kafka (and spring boot)

I have the following situation: I have 5 instances of the same service, all in the same kafka consumer group. One of them has a websocket connection to the client (the graphql subscription). I use graphql-java and Spring Boot. When that connection…
talabes
  • 5,344
  • 2
  • 22
  • 27
1
vote
2 answers

Generate Subscription with arguments in AWS AppSync with GraphQL Transform

I’m currently using GraphQL transform lib to generate all my schema. I have a model defined like this: type Feedback @model { id: ID! event: Event! @connection(name: "EventFeedbacks") submittedDate: AWSDateTime! } and the auto-generated…
odieatla
  • 1,049
  • 3
  • 15
  • 35
1
vote
1 answer

How to use graphql subscriptions in android client

How can I use graphq subscriptions in Apollo Android client. Now I have code on my server: type Subscription { targetLocationUpdated(id: String!): Target } And code of my resolver: Subscription: { locationAdded: { subscribe: ()…
1
vote
1 answer

GraphQL.js Subscription response error when nested queries/resolvers

I have the following subscription query that works fine: subscription{ streamShipmentOrder{ id } } But the following sends an "Cannot read property 'ShipmentOrder' of undefined" error subscription{ streamShipmentOrder{ id logs{ …