Fork me on GitHub
#graphql
<
2021-10-15
>
fabrao00:10:22

is there any way to disable extensions from json response?

{
"data": {
    "acessoSistema": {
      "codigo": 1,
      "mensagem": "",
      "token": "AHAHAHAHHAHAHAHAHAHHA"
    }
  },
  "extensions": {
    "tracing": { ...

fabrao00:10:09

I mean, disable tracing

thumbnail06:10:49

https://lacinia.readthedocs.io/en/latest/tracing.html the docs mention removing an interceptor from the pipeline

thom11:10:05

what's the easiest way to generate an SDL file for an existing GraphQL endpoint, from Clojure or Java?

thumbnail13:10:33

You can run an introspection query, although it doesn't include directives other than @deprecated iirc.

hlship16:10:16

There’s been repeated talk of Lacinia code that could generate SDL directly from the compiled schema; I started that, but ran out of time; others have mentioned taking a crack at it. It’s not hard, though if you want pretty output, it’s a little bit more involved.

Lennart Buit15:10:52

Lets say that I have a streamer that produces subsequent ints:

(defn my-int-streamer [ctx args source-stream]
  (doall (for [i (range 5)] (source-stream i)))
  (fn []))
Should I be able to rely on the websocket messages being in the same order as the invocations of source-stream? Like this:
{:type "data" :payload {:data 0}}
{:type "data" :payload {:data 1}}
{:type "data" :payload {:data 2}}
{:type "data" :payload {:data 3}}
{:type "data" :payload {:data 4}}
If thats the intention, I think lacinia-pedestal has a race condition: nested selections are resolved on async/thread’s, but the subscription go-loop does not park itself while this thread is running. Therefore, subsequent source-stream calls from a resolver may reorder on the websocket depending on the execution time of their nested selection.

Lennart Buit15:10:02

I think the solution is relatively easy, the subscription go loop should probably park itself (with async/<!) until the completion of the resolving of the nested selection here: https://github.com/walmartlabs/lacinia-pedestal/blob/master/src/com/walmartlabs/lacinia/pedestal/subscriptions.clj#L360-L369

Lennart Buit15:10:46

Totally willing to contribute this, if we deem this a bug 🙂

oliy15:10:22

we've done something similar in our codebases, but we return a promise that's only delivered when the execution has finished so that the caller can block on it

Lennart Buit19:10:52

If that’s inside the go loop, isn’t that a blocking call you want to avoid?

Lennart Buit19:10:03

Oh ah you make the streamer block?

oliy20:10:56

Also prevents a backlog building up where the streamer is invoked faster than the query can be resolved

hlship22:10:24

I'd be interested in a PR.

hlship19:10:06

The reality is that our main web service is now behind an Apollo Federated gateway which disallows subscriptions. We end up with a lot of clients treating us like a REST service (need to query everything to make my TypeScript classes happy). So we are not eating our own dogfood, subscriptions-wise.

hlship19:10:06

On the other hand, all those alphas? Those are to go up into our production, and we use everything else in Lacinia in one way or another.

Lennart Buit07:10:47

Hehe, yeah, I kinda assumed already you guys weren’t using it much in prod. I’ll see if I can take a crack at that PR soon, I’ll incorporate both my solution and oliy’s so we can discuss on GH.