This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-03-26
Channels
- # announcements (6)
- # beginners (51)
- # cider (3)
- # cljsrn (9)
- # clojure (4)
- # clojure-argentina (1)
- # clojure-houston (2)
- # clojure-italy (5)
- # clojure-nl (1)
- # clojure-spec (14)
- # clojurescript (17)
- # community-development (2)
- # cursive (53)
- # datomic (69)
- # fulcro (5)
- # graphql (15)
- # immutant (6)
- # jobs (2)
- # kaocha (1)
- # leiningen (15)
- # lumo (5)
- # midje (1)
- # nrepl (6)
- # off-topic (119)
- # pathom (11)
- # tools-deps (5)
@oliy @hiredman @lennart.buit: Regarding authentication of GraphQL requests: I have the Pedestal interceptor set up to add an :authorization
field to the context
, but in Lacinia's context
I cannot find that field. Any idea what I need to do?
Figured it out by reading the inject-app-context-interceptor
: https://github.com/walmartlabs/lacinia-pedestal/blob/master/src/com/walmartlabs/lacinia/pedestal.clj#L315
I need to (assoc-in [:request :lacinia-app-context :authorization] data))
into the Pedestal context
in an interceptor. Lacinia will apparently put everything in the :request :lacinia-app-context
key in the Lacinia resolver context
.
there is some lacinia function that turns the query string into a clojure datastructure? (lacinicia/parse-query schema "{hello}") => {:op :query :key :hello ...}
SOLVED: com.walmartlabs.lacinia.parser.query/parse-query
tnks
@hiredman @oliy @lennart.buit: Again regarding authentication: How does this work for WebSockets? I understand I should send an "initial payload" to the server that contains the authentication token. But where would I receive that? I assume it is not the same regular Pedestal interceptor that I use to check the token in the HTTP header for GraphQL-over-HTTP queries? Where do I need to look for that initial payload in my server code?
Also, you can just ask your questions in this channel in general. There are plenty of people here willing to help! No need to mention specific people
OK! Just thought because y'all gave the initial suggestion regarding interceptors for HTTP / initial payloads for WebSockets.
no worries! Totally willing to help, but some people may be more “annoyed” by being mentioned so to say
I must admit that a coworker of mine did something with that, but I haven’t
So, I wouldn’t be able to tell you
I am not using pedestal, so I don't know. I start a stateful go loop that consumes messages from a socket io socket, and until it gets an authentication message it ignores graphql messages
@urzds I can't remember right now, but I can have a look in the codebase at work and let you know tomorrow
@hiredman So you wrote a replacement for "lacinia-pedestal" that builds solely on http://socket.io? Is that available somewhere?
OK... Turns out one needs to read the correct documentation. There is nothing about this in the Lacinia docs, but the Lacinia Pedestal docs have reasonable hints on how to achieve this:
• https://lacinia-pedestal.readthedocs.io/en/latest/subscriptions.html (regarding the general concepts)
• https://walmartlabs.github.io/apidocs/lacinia-pedestal/com.walmartlabs.lacinia.pedestal.subscriptions.html (shows me that there are default-subscription-interceptors
- similar to the HTTP case - which contain a ::inject-app-context
interceptor, which I should overwrite / extend)