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

Lighthouse testing with postGraphQL fails when using subscriptions

I have a laravel package which uses GraphQL (Lighthouse) to extend my base project(s). Everything works fine when adding my package and doing queries etc. But since I try to make a postGraphQL request within my testing file, where the given query or…
carsten
  • 191
  • 1
  • 2
  • 7
0
votes
1 answer

How does `variables` work in `graphql-subscriptions` withFilter function?

I create a nodejs graphql application using graphql-subscriptions library to handle pubsub. Below is the source code: import { withFilter } from 'graphql-subscriptions'; const SOMETHING_CHANGED_TOPIC = 'something_changed'; export const resolvers =…
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
0
votes
1 answer

Vert.x - GraphQL Subscriptions with DataInputStreams

I have 3rd party code that I connect to via DataInputStream. The 3rd party code continually spits out information as it generates it. When something of interest comes across I want to pass it along to GraphQL Subscription(s) I'm not sure how to wire…
ekjcfn3902039
  • 1,673
  • 3
  • 29
  • 54
0
votes
2 answers

How should I setup the schema for deletion subscription?

I tried type Mutation { deleteUser(id: ID!): User @delete @broadcast(subscription: "userDeleted") } type Subscription { userDeleted(id: ID!): User } and I created a subcription where the methods authorize and filter return true. But I get…
0
votes
1 answer

Graphql subscription for asynchronous computation in AWS AppSync

I want my React web app to receive messages using AWS AppSync subscriptions for mutations that are computed asynchronously, based on mutations to types other than the type the client originally submitted a request to mutate. For example, if a user…
cyrf
  • 5,127
  • 6
  • 25
  • 42
0
votes
1 answer

What is the best approach to keep Android app running 24/7?

I have developed a react-native app for Android to receive real time food orders (like Uber Eats, Postmates, etc.). The app is running in a Lenovo tablet that is constantly charging. I use a GraphQL subscription to detect new orders and Firebase…
0
votes
1 answer

prisma2 subscriptions returns data: null

I have a basic pubsub working here using the boilerplate and graphql-yoga: https://github.com/ryanking1809/prisma2_subscriptions https://codesandbox.io/s/github/ryanking1809/prisma2_subscriptions/tree/sql-lite With a publish mutation: const…
Ryan King
  • 3,538
  • 12
  • 48
  • 72
0
votes
1 answer

Subscribing multiple AppSync users to the same Model mutation

Within AppSync I have 2 users, Adam and Eve, both using the same Car (identified by a VIN). When Adam startsCar he is subscribed to updateFuel mutation. How can I have Eve subscribing to updateFuel the moment Adam does a startsCar call ? I am…
0
votes
1 answer

Apollo GraphQL: MQTT Subscribe to a Broker to just provide the published data

Scenario I have a sensor node which publishes information on a specific MQTT Topic (sent to a Mosquitto broker). The data sent is a pure string. Backend currently I am using apollo-server-express to build a GraphQL Server. I wish to use…
Shan-Desai
  • 3,101
  • 3
  • 46
  • 89
0
votes
1 answer

How to run Appsync Subscriptions on graphql playground

I have deployed the graphql API on aws using the appsync service. I am able to run queries, mutation, and subscription on amazon console but when I am trying to test subscription on any graphql playground, its shows error. I have used serverless…
0
votes
1 answer

GraphQL: Field Resolver Not Firing on Subscription Query?

I've got a subscription query, MessageFolder_Subscription, that looks like this: QUERY const MESSAGEFOLDER_SUBSCRIPTION_QUERY = gql` subscription ($localUserID: String!){ MessageFolder_Subscription(userID: $localUserID){ id …
VikR
  • 4,818
  • 8
  • 51
  • 96
0
votes
1 answer

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 in the ComponentDidMount() method of the App.js…
0
votes
1 answer

How to efficiently sync Apollo's cache using subscriptions and AWS AppSync

I'm using aws-appsync in a Node.js client to keep a cached list of data items. This cache must be available at all times, including when not connected to the internet. When my Node app starts, it calls a query which returns the entire list of items…
0
votes
1 answer

How to create AND stop unique timer for each user in GraphQL mutations/resolvers

I'm making an app which requires that I give each user a 6 second interval timer that will complete actions every 6 seconds. I already have it working that the timers can be unique based on the function but the main issue is that I cannot…
0
votes
1 answer

Creating subscription using graphene relay

I am new to graphQL graphene(python). I would like to know if it is possible to create subscription root type using graphene. Thank you