All Questions
Tagged with react-apollo graphql-subscriptions
22 questions
1
vote
0
answers
434
views
GraphQL Subscriptions not working on Firefox - Error 400 bad Request
I have a Frontend app that is built in React and it is connected to a GraphQL backend using Apollo Client.
Queries and Mutations are working fine in all browsers, but I have an issue with the ...
1
vote
1
answer
765
views
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 ...
0
votes
1
answer
207
views
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&...
3
votes
0
answers
1k
views
React Apollo: GraphQL Subscription hangs on loading
I'm having trouble with GraphQL Subscriptions in React-Apollo. The issue is that when I create a subscription it gets stuck on loading forever. Despite that, the GraphQL Subscriptions work in gql-...
0
votes
1
answer
72
views
Apollo graphQL subscription Which package to use
I see for Apollo graphql if i wan to use plain Apollo subscription, I can import PubSub from Apollo-server or graphql-subscription . Wondering which one is correct to use ?
0
votes
1
answer
797
views
Apollo useSubscription doesn't work for new windows
This is my first time using useSub and I noticed that although my backend sends it's responses to the client (at least the console.log shows it is). The client using useSub doesn't do anything. I ...
2
votes
0
answers
508
views
React Component subscription detect GraphQL server not responding
I have a device that sends a heartbeat to my Apollo GraphQL server every 30 seconds. I have a React component that subscribes to hbReceived, and displays the most recent heartbeat time. This works ...
1
vote
1
answer
1k
views
How to setup ApolloServer and SubscriptionServer to use http and ws in graphql
I have been following the docs for here and here to implement the subscriptions-transport-ws plugin. My big confusion is differentiating the graphql url for http:// and ws://. In the examples above it ...
1
vote
3
answers
2k
views
How to prevent re-rendering with useSubscription()?
Many of you might have heard of GraphQL. It provides QUERY and MUTATION. Also it supports SUBSCRIPTION as 100% replacement of web socket. I'm a big fan of GraphQL and hooks. Today I faced an issue ...
1
vote
1
answer
2k
views
Apollo useSubscription hook not emitting new data
I have created subscription whenever a new post is added. The subscription works fine on the graphiql interface.
Here is my react code to use useSubscription hook
export const SUSCRIBE_POSTS = gql`
...
2
votes
1
answer
817
views
How do I use two different websocket url based on context in react-apollo?
I have got a problem.
The scenario is we have two graphql servers.
I have split them passing context in the query/mutation options.
It works but I also have two different websocket setup.
As we ...
6
votes
0
answers
1k
views
React Apollo - subscribeToMore / updateQuery updates propagating erroneously
A strange scenario with GraphQL. Let's say there is a Subscription called postIsRead, which signifies a post in a list of posts as currently being read, such as:
Post: {
id: 1,
read: true
}
Only ...
1
vote
1
answer
133
views
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!){...
1
vote
0
answers
752
views
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-...
0
votes
1
answer
1k
views
Need to use setstate() of data received from GraphQL subscription in react-apollo
I am trying to setState() of the GraphQL subscription Query that I am doing through react-apollo. My purpose is to store the complete the object that I received from GraphQL and save it into the state ...