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

Subscription field must return Async Iterable. Received: [function]

I am trying to filter the subscriptions to make sure each client only receives data they need. However, I get an error when I work with this implementation /** * Relevant packages and their versions * "apollo-server-core": "^3.6.2", * …
Sean
  • 360
  • 3
  • 17
0
votes
2 answers

Load/stress test in a SPA with Hasura Cloud Graphql as a backend and subscriptions

I'm trying to do a performance test on a SPA with a Frontend in React, deployed with Netlify As a backend we're using Hasura Cloud Graphql (std version) https://hasura.io/, where everything from the client goes directly through Hasura to the…
0
votes
1 answer

How to enable graphql subscription in loopback 4 with openapi-to-graphql

as per the title, I am having problem trying to enable graphql subscription in my loopback 4 application. Here is my code that I've done so far. index.ts export async function main(options: ApplicationConfig = {}) { const app = new…
Rasyue
  • 60
  • 1
  • 9
0
votes
1 answer

Access latest value of state in aws amplify subscriptions react

I have a useEffect hook with a subscription listener using aws-amplify like this. useEffect(() => { todoUpdatedSubs.subscribe({ next: (status: SubscriptionStatus) => { setIsTaskUpdated(true); …
0
votes
1 answer

"error": "Could not connect to websocket endpoint ws://localhost:8000/subscriptions. Please check if the endpoint url is correct." for graphql spqr

I have my data stored in mongodb and I'm trying to implemet subscription using graphql spqr and project reactive. I'm getting respones for when I'm trying to test mutations and query, but I keep on getting the following error message for…
0
votes
1 answer

Azure function - GraphQLHttpClient with CreateSubscriptionStream

I have a requirement like I want to subscribe an GraphQLHttpClient using CreateSubscriptionStream into a function app . stream.Subscribe( response => { Console.WriteLine($"RaceUpdatesSubscription…
amethianil
  • 480
  • 2
  • 7
  • 16
0
votes
1 answer

FastAPI graphql subscriptions

I try to implement simple graphql subscription on FastAPI. According to documentations but it is not working import asyncio import graphene from fastapi import FastAPI from starlette.graphql import GraphQLApp from…
dmitriy_one
  • 477
  • 1
  • 5
  • 16
0
votes
1 answer

AWS App Sync Subscriptions over MQTT is not supported

While using AWS AppSync SDK to add subscription its returning this error, but I got the result in AWS console. errorType: "BadRequestException" message: "Subscriptions over MQTT is not supported." I have seen this similar question and tried the…
0
votes
0 answers

GraphQL subscription does not receive messages after successful handshake

I have created a simple GraphQL Subscription using Nest.js/Apollo GraphQL over Node.js. My client application which is a react.js/apollo client works find with the server. The client subscibes to the server via GraphQL similar to: subscription { …
Afshar Mohebi
  • 10,479
  • 17
  • 82
  • 126
0
votes
0 answers

Apollo GraphQL v3 subscription returning null

I'm having a super hard time with setting up subscriptions in apollo-server. It's listening, I can make the mutation and query the result. But, the subscription for the same data returns null every time. Here are the important parts of my…
0
votes
0 answers

Invalid Syntax error while consuming graphql API

I am also facing some issue while hitting Graphql APIs through postman. http://testEnvrironment/restcall/getReports POST body getReports(id:15){ isApproved } } Entries of sample.graphqls file is schema{ query: Query } type…
0
votes
1 answer

Graphql subscription not getting client-side variables

I am trying to subscribe to a graphql-yoga subscription using apollo-client useSubscription hook import React from 'react'; import {useSubscription,gql} from '@apollo/client'; const SUB_NEW_MSG = gql` subscription SUB_NEW_MSG($chatRoom:ID!) …
0
votes
1 answer

WebSocket connection cannot be established when used in graphql client

i am trying to fetch data to the client through subscriptions from a graphql server. in order to do so we need to establish a websocket connection first. However when I try to do it i get the following error back error: WebSocket connection to…
0
votes
1 answer

Could not find "client" in the context or passed in as an option issue when using subscriptions

I need to fetch some data in real-time. So I decided to use the WebSocket connection import { ApolloClient } from "apollo-client"; import { InMemoryCache } from "apollo-cache-inmemory"; import { ApolloLink, split } from "apollo-link"; import {…
Dulara Malindu
  • 1,477
  • 4
  • 18
  • 37
0
votes
1 answer

Subscription field must return Async Iterable. Received: undefined

I use graphql nodejs with apollo-server. When i try i got this error: I already i returns pubsub.asyncIterator in resolver. It returns error. Another project same setting works but there it is not working. I examine some stack issues here but i…