Fork me on GitHub
#graphql
<
2018-03-13
>
guy08:03:47

thanks @mattly ill check it out šŸ˜„

josef11:03:10

Hello, has anyone managed to authenticate over websockets in order to have authenticated subscriptions? I am using lacinia-pedestal, as far as I see something like this is not supported (yet)? https://www.apollographql.com/docs/graphql-subscriptions/authentication.html

oliy11:03:26

@jerben we are using cookies to authenticate, we use the init-context argument to get the cookie off the upgrade request and decide whether to allow the upgrade to go ahead

oliy11:03:46

there's an open issue for this on lacinia-pedestal if i remember correctly

josef12:03:00

@oliy Cool thanks for the hint, I will try it out! šŸ™‚

gklijs13:03:02

@jerben I did it sometime, but in this case you first had to login on a page, then the username would be stored in the session, and only with a user with certain roles the websocket was initiated

nooga13:03:05

Iā€™m trying to add auth to lacinia-pedestal setup, I basically just put and auth interceptor in the service map (-> (lacinia/service-map ...) ... (assoc ::pedestal/interceptors [(auth/check-auth auth)]) (pedestal/create-server)).

nooga13:03:11

Is this the right way of doing things? Iā€™m getting non descriptive {:msg "sending error", :message "Internal server error: no response", :line 214} error when the auth succeeds

hlship17:03:03

That looks like you replaced the interceptors provided by Lacinia with just your auth interceptor.

nooga13:03:14

Or maybe let me rephrase: How do I add an interceptor in front of all lacinia-pedestal routes and not break anything?

josef14:03:37

@nooga Regarding queries/mutations, we currently read an auth token from the context in the resolver function and resolve accordingly.

nooga14:03:03

I managed to inject the auth interceptor this way

eggsyntax17:03:26

I just discovered that field names in lacinia have to be simple keywords, no namespaces allowed. Anyone know whether that's ultimately a limitation of GQL, or if it's just lacinia?

hlship17:03:54

It is in accordance with the GraphQL spec.

eggsyntax17:03:29

Damn, ok. That doesn't play so nicely with clj's love of namespaced keywords šŸ˜œ

hlship17:03:39

I wish the GraphQL folks had talked to us Clojure folks before going off and designing something.šŸ˜‰

eggsyntax17:03:50

I know, right? šŸ˜‰