Fork me on GitHub
#pathom
<
2020-05-18
>
myguidingstar11:05:29

is there any function to extract the eql from an arbitrary piece of data, eg given {:x 1 :y 2 :z [{:t 3 :u 4}] returns [:x :y {:z [:t :u]}]?

myguidingstar15:05:57

must be it. Thank you!

kszabo11:05:37

not currently AFAIK

dvingo13:05:54

I am connecting my pathom parser to pathom viz and I'm getting transit encoding errors for unsupported types, in this case #tick/date. Is there a place to add transit handlers for your own types?

#error {
 :cause "Not supported: class java.time.LocalDate"
 :via
 [{:type java.lang.RuntimeException
   :message "java.lang.Exception: Not supported: class java.time.LocalDate"
   :at [com.cognitect.transit.impl.WriterFactory$1 write "WriterFactory.java" 65]}
  {:type java.lang.Exception
   :message "Not supported: class java.time.LocalDate"
   :at [com.cognitect.transit.impl.AbstractEmitter marshal "AbstractEmitter.java" 194]}]
 :trace
 [[com.cognitect.transit.impl.AbstractEmitter marshal "AbstractEmitter.java" 194]
  [com.cognitect.transit.impl.JsonEmitter emitMap "JsonEmitter.java" 171]
  [com.cognitect.transit.impl.AbstractEmitter emitMap "AbstractEmitter.java" 85]
  [com.cognitect.transit.impl.AbstractEmitter marshal "AbstractEmitter.java" 184]
  [com.cognitect.transit.impl.AbstractEmitter emitArray "AbstractEmitter.java" 97]
  [com.cognitect.transit.impl.AbstractEmitter marshal "AbstractEmitter.java" 182]
  [com.cognitect.transit.impl.JsonEmitter emitMap "JsonEmitter.java" 171]
  [com.cognitect.transit.impl.AbstractEmitter emitMap "AbstractEmitter.java" 85]
  [com.cognitect.transit.impl.AbstractEmitter marshal "AbstractEmitter.java" 184]
  [com.cognitect.transit.impl.JsonEmitter emitMap "JsonEmitter.java" 171]
  [com.cognitect.transit.impl.AbstractEmitter emitMap "AbstractEmitter.java" 85]
  [com.cognitect.transit.impl.AbstractEmitter marshal "AbstractEmitter.java" 184]
  [com.cognitect.transit.impl.AbstractEmitter marshalTop "AbstractEmitter.java" 211]
  [com.cognitect.transit.impl.JsonEmitter emit "JsonEmitter.java" 41]
  [com.cognitect.transit.impl.WriterFactory$1 write "WriterFactory.java" 62]
  [cognitect.transit$write invokeStatic "transit.clj" 167]
  [cognitect.transit$write invoke "transit.clj" 164]
  [com.wsscode.transit$write invokeStatic "transit.cljc" 37]
  [com.wsscode.transit$write invoke "transit.cljc" 33]
  [_connector.impl.http_clj$send_message_BANG_ invokeStatic "http_clj.clj" 18]
  [_connector.impl.http_clj$send_message_BANG_ invoke "http_clj.clj" 15]
  [_connector.impl.http_clj$connect_parser$fn__56379 invoke "http_clj.clj" 75]
  [_connector.core$connect_parser$connected_parser__56389$fn__56445$state_machine__7701__auto____56470$fn__56473 invoke "core.cljc" 57]
  [_connector.core$connect_parser$connected_parser__56389$fn__56445$state_machine__7701__auto____56470 invoke "core.cljc" 56]
  [clojure.core.async.impl.ioc_macros$run_state_machine invokeStatic "ioc_macros.clj" 978]
  [clojure.core.async.impl.ioc_macros$run_state_machine invoke "ioc_macros.clj" 977]
  [clojure.core.async.impl.ioc_macros$run_state_machine_wrapped invokeStatic "ioc_macros.clj" 982]
  [clojure.core.async.impl.ioc_macros$run_state_machine_wrapped invoke "ioc_macros.clj" 980]
  [clojure.core.async.impl.ioc_macros$take_BANG_$fn__7719 invoke "ioc_macros.clj" 991]
  [clojure.core.async.impl.channels.ManyToManyChannel$fn__2538$fn__2539 invoke "channels.clj" 95]
  [clojure.lang.AFn run "AFn.java" 22]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1128]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 628]
  [clojure.core.async.impl.concurrent$counted_thread_factory$reify__2407$fn__2408 invoke "concurrent.clj" 29]
  [clojure.lang.AFn run "AFn.java" 22]
  [java.lang.Thread run "Thread.java" 834]]}

wilkerlucio15:05:48

can you check with transit version are you using? they had a bug that was recently fixed related to fallback encodings, I believe if you use latest transit it may fix, but if not please let me know and lets debug it

dvingo15:05:38

sure thing: using clj -Stree:

com.wsscode/pathom-viz-connector 1.0.2
  com.wsscode/async 1.0.4
  com.cognitect/transit-clj 1.0.324
    com.cognitect/transit-java 1.0.343
com.cognitect/transit-cljs 0.8.264
com.cognitect/transit-js 0.8.861
I have the following in deps.edn:
com.fulcrologic/fulcro {:mvn/version "3.2.5"
                         :exclusions  [com.cognitect/transit-cljs                       
                                      com.cognitect/transit-js]}
com.cognitect/transit-cljs          {:mvn/version "0.8.264"}
com.cognitect/transit-js            {:mvn/version "0.8.861"}

dvingo15:05:11

the cljs and js versions were older pulled in from fulcro, I updated those but the issue is still happening (i assume it's in clojure anyway not cljs)

dvingo21:05:49

I'm still seeing the same error. I can try running the app locally in dev mode to see if i can find where it's falling over

wilkerlucio00:05:40

sorry the delay, got sidetracked on this, ok, I decided to force the fix to don't rely on transit version, I was able to run a parser returning a LocalDate, can you try version 1.0.3 of the connector and see if that works?

dvingo02:05:16

no problem! thanks for the quick fix, looks like it's working now 🙂

lepistane16:05:28

Hello, I apologize in advance for the question for the zone "i dont know what i dont know" i am very interested in pathom but don't know how to handle it. it's just too complex and i lack foundational knowledge in order to use it. I couldn't get EQL but after looking at GraphQL and playing around with it little bit with my brother when he was preparing for interview i finally understood EQL. I even get pathom bit more but still have issues even with simple example from docs. Where would i need to look to build up my foundation and better understand terminology and thinking about this topic? I feel like with pathom i could create integration between api and this seems very very powerful

dvingo21:05:20

I'd say one of the best stories for learning is focusing on fulcro, which makes using pathom easier. There's tons of documentation and videos. https://www.youtube.com/playlist?list=PLVi9lDx-4C_T7jkihlQflyqGqU4xVtsfi

dvingo21:05:38

Some of the server videos in that playlist have pathom setup

souenzzo20:05:59

As a early-user of om/fulcro/pathom/EQL, the community is really small and there is a lot of WIP things (including naming) We need more users, more discussion, more uses to advance in naming/docs/explanations

wilkerlucio21:05:54

we gonna a real good oportunity for that soon, stay tuned 🙂

🚀 20