Fork me on GitHub
#graphql
<
2020-08-03
>
deadghost19:08:38

Anyone have good results from lacinia + datomic? Seems like it should work ok but I'm encountering pain in the butt things like graphql not allowing kebab-case and losing keyword namespaces.

oliy19:08:58

This is what I wrote locksmith for https://github.com/oliyh/locksmith

vlaaad19:08:43

I think this is a part of graphql spec to not allow dashes and slashes

deadghost19:08:19

right, so right now I'm planning on doing "user_id", "db_id", "user_anotherId" to get around it

deadghost19:08:59

and let the frontend parse into :user/id, :db/id, :user/another-id

okwori19:08:10

You can use clojure.set fxn as an easy workaround

okwori19:08:39

rename-keys

okwori19:08:04

Eg:

(def ^:private kmap {:user/id :id, :user/first-name :first_name})

(defn get-user [_ args _]
  (clojure.set/rename-keys (get-user (d/db db/conn) 
                                        (:id args)) kmap))

subsaharancoder21:08:18

I'm using Lacinia to build a graphQL server, I noticed that pedestal/service-map was deprecated so I switched to pedestal2/default-service nil but I'm noticing a tonne of WS errors, the server runs fine but this error is pretty annoying, any idea what's going on? :

ERROR com.walmartlabs.lacinia.pedestal.subscriptions - {:event :com.walmartlabs.lacinia.pedestal.subscriptions/error, :line 513}
java.io.EOFException: Disconnected
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.disconnect(AbstractWebSocketConnection.java:323)
	at org.eclipse.jetty.websocket.common.io.DisconnectCallback.failed(DisconnectCallback.java:36)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.close(AbstractWebSocketConnection.java:200)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.remoteClose(AbstractWebSocketConnection.java:279)
	at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:109)
	at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:319)
	at org.eclipse.jetty.websocket.common.extensions.AbstractExtension.nextIncomingFrame(AbstractExtension.java:147)
	at org.eclipse.jetty.websocket.common.extensions.compress.PerMessageDeflateExtension.nextIncomingFrame(PerMessageDeflateExtension.java:112)
	at org.eclipse.jetty.websocket.common.extensions.compress.PerMessageDeflateExtension.incomingFrame(PerMessageDeflateExtension.java:71)
	at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:201)
	at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:226)
	at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:255)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:581)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:434)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
	at java.base/java.lang.Thread.run(Thread.java:832)