Requesting feedback: GraphQL Subscription JS package design for use with ports #558
Replies: 2 comments
-
Looks great :) Here is what I felt based on my experience working with apollo-style-subscriptions
For example: Lets say I am placing an order. The state the order can be are as follows
If the front end is subscribing to this table. It should be able to unsubscribe once all of above turns Hope this is useful :) kindly let me know what you think? |
Beta Was this translation helpful? Give feedback.
-
Currently using elm-graphql with backend in Absinthe. I definitely think there is a good use case for unsubscribing - lets say I have a list of I'd imagine that given a subscription, serialize its arguments and that would give you a unique identifier |
Beta Was this translation helpful? Give feedback.
-
I would love feedback from anyone who is using GraphQL Subscriptions, or interested in using Subscriptions, who could give me some feedback based on their use case.
My goal is to publish a very simple JavaScript/TypeScript library that can be a community standard (that community members can contribute to and improve) that makes it easy to connect up GraphQL Subscriptions through a couple of ports.
Here are some rough notes for my current thinking:
port module GraphqlSubscription
, and only expose a function which takes a GraphQL SubscriptionSelectionSet
, and gives you back aCmd
andSub
that you can register to wire up GraphQL Subscriptions (see https://github.com/IncrementalElm/postgraphile-pomodoro/blob/master/client/src/GraphqlSubscription.elm)My thoughts on the JavaScript/TypeScript module:
cmdAndSub
, you will only get incoming GraphQL Subscription Payloads for the exact query that you sent out when you called that.Any and all feedback is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions