This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-05
Channels
- # announcements (7)
- # babashka (61)
- # beginners (146)
- # cider (4)
- # clj-kondo (25)
- # cljsrn (29)
- # clojars (30)
- # clojure (30)
- # clojure-australia (17)
- # clojure-europe (43)
- # clojure-italy (16)
- # clojure-nl (2)
- # clojure-spec (13)
- # clojure-sweden (7)
- # clojure-uk (8)
- # clojurescript (38)
- # cursive (12)
- # datomic (42)
- # defnpodcast (2)
- # dirac (1)
- # events (5)
- # fulcro (5)
- # graalvm (43)
- # graphql (11)
- # helix (6)
- # jackdaw (13)
- # jobs (4)
- # lambdaisland (8)
- # malli (12)
- # off-topic (83)
- # pathom (9)
- # podcasts-discuss (2)
- # re-frame (6)
- # reagent (3)
- # reitit (8)
- # remote-jobs (1)
- # shadow-cljs (40)
- # vim (21)
What does the source-stream method do?
As you are using it with Kafka, https://github.com/gklijs/bkes-demo/blob/main/graphql-endpoint/src/nl/openweb/graphql_endpoint/transaction_service.clj might help as example.
Internally, Lacinia uses core.async to model the asynchronous behavior associated with streams.
However, it doesn't expose that directly, instead it provides a function, a source stream, that your code may repeatedly invoke.
That function puts values into the necessary core.async channels, and ultimately, ensures that the data is pushed down to the client.
okay, thank you @U26FJ5FDM @U04VDKC4G
If we have it (source-stream (sum a b)) then we should run the subscription as {subscription (a:1, b:2) {ask anything to return}}
Yes, something like that. But it's an subscription, so you need something in place that when whatever happens that should result in a new message, you call the source-stream
function again.
okay, thanks @U26FJ5FDM
Does lacinia
support Long
type in some way? According to https://graphql.org/learn/schema/ it is not part of the standard but individual implementations can support “custom” types. The reason I ask is that a portion of my backend is using Datomic and Datomic ids are Long
which is causing problems for lacinia
. Currently, I’m converting them to strings but would prefer not to.