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

How to implement Group Chat using Appsync Graphql?

Present I have list users and also each user conversation list but trying to implement Group Chat to add multiple users to chat once at a time using Amplify, GraphQL and React JS.
Naga
  • 11
  • 1
0
votes
0 answers

todo list optimistic subscription updates with Apollo GraphQl

I am trying to get an optimistic response when I add a task to my todo list: ADD_TASK and GET_TASK from query.ts export const GET_TASKS = gql` subscription { queryTask { id title completed user { username …
Jonathan
  • 3,893
  • 5
  • 46
  • 77
0
votes
1 answer

GraphQL subscribe to specific room's (by roomId) settings change

I would like to use gql subscription to watch for game room's settings change. I have list of Rooms with unique roomCode. Every Room has settings properties. Example: class Room { roomCode: string; settings: { difficulty otherSetting …
0
votes
1 answer

Uncaught Invariant Violation: Store error

I am attempting to write a HackerNews clone using a graphql api written in Go with the graph-gophers package as the backend, and a Vuejs app with the apollo graphql-client as the frontend. Relevant Github Repos Backend Frontend. I have recently…
0
votes
2 answers

Hot Chocolate "RESULT_TYPE_NOT_SUPPORTED" on subscription

edit 00: NOTE: This message is coming from the GraphiQL interface. When I tried the same query in the 'Banana Cake Pop' UI, no message is returned when I execute this query. While trying to create a GraphQL subscription on an ASP.NET web server,…
0
votes
1 answer

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

How to tear down subscription for unauthorized resource

Below is the prototype of my apollo subscription implementation. Every user can connect to websocket with or without authentication token. But only when they send request, I should be able to either service that request if user is authorized or tear…
Pablo
  • 28,133
  • 34
  • 125
  • 215
0
votes
1 answer

Appsync's graphql subscription not working with PHP5

Can anyone help me with a working example of graphql subscription with php5 and AWS Appsync or php5 WebSocket client which works with Appsync? I am trying textalk but haven't got any success.
0
votes
1 answer

Apollo GraphQL with Vertx Subscription failed

I'm running Hasura GraphQL on docker instance(window machine) exposed at http://192.168.99.100:8080/v1/graphql I want to perform subscription in my verticle but getting the following exception: …
0
votes
1 answer

Why "first" is undefined argument in GraphQL?

I am trying to retrieve only 5 first records from my query and I saw that there was the keyword "first" to do that onGraphQL. I tried and it says undefined argument. Since it is a GraphQL keyword why it does not recognize it? I am using Ruby on…
0
votes
1 answer

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 usually use subscribeToMore with query, but for this…
0
votes
1 answer

Graphql subscription does not catch client-side variables

I am trying to use graphql subscriptions using the following libraries: graphql-subscription on the server-side subscription-transport-ws on the client-side and when not using the filtering mechanism every thing goes right. But when I add the…
ConductedClever
  • 4,175
  • 2
  • 35
  • 69
0
votes
1 answer

How to create a basic client to use GraphQL subscriptions via websockets

I'm trying to create a basic chat-like app just for the sake of learning a few things. I have set up a basic graphql server to handle connecting a user, and let them add a message. Now I'm trying to add some mechanism so that every user can see each…
0
votes
1 answer

Run function before any query in GraphQL ruby

I want to run a function before any query I run on GraphQL. I want to control some condition and throw a GraphQL:: ExecutionError in case it catches the error. I know there is a base query that runs before any query but it is needed to check if a…
john bowlee
  • 125
  • 1
  • 11
0
votes
1 answer

AWS Appsync subscription filter between timestamp range

I've an AWS AppSync API that subscribes to a createVisitorRecord mutation. This mutation writes a new record to dynamodb. Th primary key is a combo of a partition key location_id and sort key visit_time where visit_time is a timestamp. Here's the…