Fork me on GitHub
#pathom
<
2021-02-10
>
mss02:02:18

when working with datomic + pathom, is it insane to have multiple entities each have a :`db/id` key, especially considering the case where that :db/id might be the input to other resolvers?

mss02:02:34

my inclination is that would break and/or be a terrible idea, but not positive on that

souenzzo03:02:25

@mss in pathom2 with pc/reader2, if you use :db/id in every resolver, you may experience some performance issues IDK the current status for pathom3 Anyway, I use pathom2 with datomic, and manually extract each pull from my system. Not a big deal 🙂

👍 8
mss03:02:24

appreciate the response and insight!

Björn Ebbinghaus15:02:07

I think the best solution is not to use :db/id as a key for your API. :db/id identifies an entity in your DB. You can use a key :user/id or :watever-model/id for public use which is another name for :db/id. Or you don't use the db/id at all and generate some other form of public id. (UUID, slugs, ...)

markaddleman20:02:05

Processing an EQL query with Pathom3, I get the following error info:

:type clojure.lang.ExceptionInfo
               :message "Insufficient data"
               :data {:required #:data-source{:id {}}, :available {}}
               :at [com.wsscode.pathom3.connect.runner$invoke_resolver_from_node$fn__45209 invoke "runner.cljc" 399]}
It would be helpful if the ex-info data included the name of the resolver(s?) that pathom tried

wilkerlucio20:02:21

you have this data in the meta

wilkerlucio20:02:58

there are ways to crunch it from there, or using pathom viz you can see the graph and analyse the parts, have you tried that?

markaddleman22:02:42

I haven't played with viz yet. Looks like I have a good reason now )

wilkerlucio22:02:13

give it a go, connect your parsers and track whats going on in the Requests tab, let me know if have any hiccups in the process

wilkerlucio23:02:06

tip: click on the bars on the trace view to open the graph view

markaddleman18:02:52

I don't have an EQL endpoint for my app. Is there a way to write up Viz as part of my REPL so it can submit EQL as a function call?

wilkerlucio18:02:58

yes, use the connector

wilkerlucio18:02:10

when you open the app, it has links for how to setup the connector

wilkerlucio18:02:15

both for pathom 2 and 3