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

Apollo Server WebSocket Connection Docker Compose Expose Problem

I am trying to develop an app with apollo graphql server and react. i susbscribe to apollo server from react container(visualization) and consume data. If i map ports of apollo server, i can connect to apollo server and react app works fine but if i…
1
vote
0 answers

Call useSubscription after loading the state value

const {authState,loading:authLoading}=useAuthState(); const { data, loading, error } = useSubscription(USER_NOTIFICATIONS, { variables: { userId:authState.userId} }); In the above code, I am getting Cannot read property…
1
vote
1 answer

Apollo cache query fields policy offsetLimitPagination() doesnt work with subscriptions

I use apollo client for react native. When I use offsetLimitPagination() for pagination my subscriptions doesn't update cache. Subscriptions works correctly but doesn't update flatlist data. When i remove offsetLimitPagination function it works. I…
1
vote
1 answer

SubscriptionDocumentExecutor in GraphQL DotNet

I am building a new GraphQL API using the GraphQL for .NET and the GraphQL for .NET - Subscription Transport WebSockets packages and I am trying to test some Subscriptions I have set up in my schema. However, I am currently getting this error when…
Mr-DC
  • 799
  • 5
  • 14
  • 25
1
vote
2 answers

Getting WebSocket connection to 'ws://localhost:7080/query' failed on connecting graphql-ws client with gqlgen golang server

The subscription query listed below in code working fine on graphql playground but when i tried to connect my graphql-ws client with gqlgen driven go server, i got WebSocket connection to 'ws://localhost:7080/query' failed error. I tried connecting…
Sahil Aggarwal
  • 129
  • 1
  • 1
  • 12
1
vote
1 answer

Open WebSockets causing latency spikes on Google App Engine

I am making use of web socket functionality on GAE flexible environment to enable a GraphQL Subscription on our API. However I have noticed in my google cloud reporting there are massive latency spikes of 30+ minutes. See below: Here is the log…
1
vote
0 answers

Python+Graphql: KeyError: 'data' recieved upon execution

Error Received I help a developer out maintaining a simple python script that scrapes images from unsee.cc. I have helped to correct URLs and remove minor problematic bits of code. Over the past two days I have received an error while running the…
1
vote
1 answer

Cross origin error thrown on GraphQL subscription

I'm setting up GraphQL subscription as per this tutorial: https://hasura.io/docs/1.0/graphql/core/guides/integrations/apollo-subscriptions.html I'm getting CORS error and all my requests to web sockets are failed. How can I resolve it?
KillMe
  • 184
  • 5
  • 20
1
vote
0 answers

Vue Apollo Query stuck in the loading state after updating with subscription

I have a SubscribeToMore subscription and I want it to update my query. I see the result of my subscription, but the query isn't updated after the return statement and the app is tucked in the loading state. Here is my query with the…
Dvdgld
  • 1,984
  • 2
  • 15
  • 41
1
vote
1 answer

Vue Apollo subscription not updating the query

It's my first time implementing a GraphQL subscription, so excuse me if it's an obvious question. I have a subscription which is working with Simple Subscription approach, but doesn't work with SubscribeToMore Here are both calls. Simple…
Dvdgld
  • 1,984
  • 2
  • 15
  • 41
1
vote
0 answers

Graphql-net server in an azure function doing subscriptions with signalR

Looking for sample code to do have a graphql-net server living in an azure function endpoint and doing subscriptions. Azure functions don't support WebSockets so thinking at using signalR. According to…
1
vote
1 answer

Amplify GraphQL subscriptions don't respond to events

I'm currently building a React Native app using AWS Amplify framework. In my app, there supposed to be a real-time dashboard that gets updated when a new item is added to the DB. To achieve this functionality, I'm using GraphQL subscriptions using…
Ido Naveh
  • 2,442
  • 3
  • 26
  • 57
1
vote
1 answer

apollo federation subscriptions on node 8.11.1

i'm new with apollo federation. I try to include subscritption which i have on my remote server (on other host written on aiohttp) to federation schema. And there are no issue when i start my node index.js but there is no subscription in docs and if…
1
vote
1 answer

How does WebSocketClient pass authentication token in Apollo Client 3.0?

By Apollo GraphQL's official doc, Apollo Client 3.0 supports authentication of WebSocket for its subscriptions. Subscriptions should be authenticated by a secure token in many cases. It was the same to me. I followed the latest doc of authentication…
1
vote
4 answers

GraphQL Subscriptions using Express-GraphQL

Can anyone tell me how to implement GraphQL Subscriptions using Express-GraphQL in Node?