graphql

deadghost 2020-08-03T19:20:38.259400Z

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.

2020-08-04T19:01:58.269400Z

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

vlaaad 2020-08-03T19:26:43.259900Z

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

deadghost 2020-08-03T19:31:19.261600Z

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

deadghost 2020-08-03T19:31:59.262200Z

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

deadghost 2020-08-03T19:32:12.262400Z

it's icky

okwori 2020-08-03T19:36:10.263900Z

You can use clojure.set fxn as an easy workaround

deadghost 2020-08-03T19:38:39.264300Z

fxn?

okwori 2020-08-03T19:51:39.264500Z

rename-keys

okwori 2020-08-03T19:58:04.264900Z

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))

souenzzo 2020-08-03T20:01:18.265700Z

@deadghost checkout https://clj-commons.org/camel-snake-kebab/

subsaharancoder 2020-08-03T21:05:18.267800Z

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)