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

Test a secure graphql subscription

I am trying to test a configuration for securing graphql subscriptions in my application. This is my config in the ApolloServer constructor: const app = express(); const jwt_authentication = jwt({ secret: JWT_SECRET, …
Strider
  • 3,539
  • 5
  • 32
  • 60
1
vote
1 answer

AppSync subscription authorization problem

Hi i am new in aws AppSync and GraphQl. I have a problem with subscription. I want to get notifiend in real time when new post is posted Here is my graphql schema `` type Mutation { addPost( id: ID!, author: String!, …
Kesa101
  • 31
  • 1
  • 4
1
vote
3 answers

Subscription component with GraphQL Apollo Client

I have an application with one subscription already using subscribeToMore Query Component: {({ data, subscribeToMore }) => { return (
1
vote
3 answers

How can I setup an Apollo client in React for both upload and subscriptions?

I would like to set up a graphql client with React for both uploading file and handle subscriptions from a graphql server. The file upload and the other queries work well. The problem is with subscriptions. I get in the browser console the…
1
vote
0 answers

graphql-subscriptions withFilter returns undefined; subscriptions without variables work ok

I'm trying to get my head around graphql-subscriptions and withFilter. Subscriptions without variables work as intended, but if I try to use withFilter, I only get 'Subscription field must return Async Iterable. Received: undefined' error when I try…
aqmattil
  • 11
  • 3
1
vote
0 answers

Spring boot graphql-java, subscriptions and streamlisteners

I'm trying to create an observable from a streamlistener response but are unable to do so. I'm quite new to the idea of EventObservable and Reactive Java. It would be helpful if someone could look into my code to see if it has been constructed the…
1
vote
1 answer

Apollo GraphQL subscription response doesn't handle nested queries

I have the following GraphQL subscription that works fine: subscription voucherSent($estId: Int!) { voucherSent(estId: $estId) { id name usedAt sentAt } } But the following sends an "Cannot read property 'User' of undefined"…
Thierry D.
  • 338
  • 3
  • 11
1
vote
2 answers

ReactJS: TypeError: Cannot add/remove sealed array elements

I'm trying to use API made with Apollo GraphQL and update react component realtime with the help of GraphQL subscriptions using subscriptions-transport-ws library. For delete operation, I'm getting TypeError: Cannot add/remove sealed array elements…
s develop
  • 115
  • 3
  • 16
1
vote
1 answer

How do I call a function whenever my Apollo subscription gets triggered in React?

I have a react component which uses the subscribeToMore method on an apollo graphql query to update itself on changes. It does that just fine, but I want to call some outside function when the subscription picks up a change. I want to show some…
James
  • 87
  • 1
  • 8
1
vote
1 answer

How to Separate GraphQL Subscriptions alone to another Server

I'm planning to Apollo-Graphql on Google App Engine (GAE). So I don't have to worry about the scaling (I'll be using Redis or some other pubsub). However, the problem is GAE doesn't support web sockets. I heavily use GraphQL subscriptions. What…
Gijo Varghese
  • 11,264
  • 22
  • 73
  • 122
1
vote
0 answers

React Apollo subscription bypasses the graphql wrapper

I have a sample app called GraphQL Bookstore that creates books, publishers and authors and shows relationships between them. I am using subscriptions to show updates in real time. For some reason my BOOK_ADDED subscription is bypassing the graphql…
Naresh
  • 23,937
  • 33
  • 132
  • 204
1
vote
1 answer

Apollo: Client-Side Subscription Code?

Here's my client-side code for Apollo subscriptions, based on the Githunt-React-master sample code: componentWillReceiveProps(nextProps) { const fromID = Meteor.userId(); const toID = nextProps.toID; if (!this.subscription &&…
VikR
  • 4,818
  • 8
  • 51
  • 96
1
vote
0 answers

Apollo Angular: How do I 'reinitate' my my watchQuery even after an error?

I have a query that searches for an object with a given $ID. It will always fail on the initial page load as we need to wait for the user to provide this $Id. I want my query to continue retrying until a correct Id is found. Right now the error goes…
viztastic
  • 1,815
  • 1
  • 17
  • 17
1
vote
1 answer

apolloClient.subsribe is undefined

I am trying to subscribe the apollo and I am getting following error apolloClient.Subsribe is undefined Attaching my client side subscription const networkInterface = createNetworkInterface('http://localhost:8000/graphql'); const wsClient = new…
Sai Ram
  • 4,196
  • 4
  • 26
  • 39
1
vote
2 answers

What's wrong with this subscription? I get updates but the view is not refreshed

I'm trying to refresh a counter with a subscription done with ApolloGraphql. It's almost workingsince I can see in the dev-tool the following data coming from the server on event: { "type": "subscription_data", "id": 0, "payload": { …
Tom
  • 785
  • 10
  • 26