pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
Tuomas 2020-06-07T03:44:34.204Z

I’ll try that combination too and after that I’ll try to usee a serial parser

(p/parallel-parser
    {::pp/timeout-reach 60000
     ::p/env            {::p/reader                 [p/map-reader
                                                     pc/parallel-reader
                                                     pc/open-ident-reader
                                                     pc/reader2
                                                     pc/async-reader2
                                                     p/env-placeholder-reader]
                         ::pc/mutation-join-globals [:tempids]
                         ::pc/thread-pool           (pc/create-thread-pool (async/chan 4000))
                         ::p/placeholder-prefixes   #{">"}
                         ::p/process-error          (fn [env err] (println err) (p/error-message err))}
     ::p/mutate         pc/mutate-async
     ::p/plugins        [(pc/connect-plugin {::pc/register resolvers})
                         (p/env-wrap-plugin (fn [env]
                                              (let [conn (app.database/get-connection)]
                                                (assoc env
                                                  :db (d/db conn)
                                                  :conn conn))))
                         (p/post-process-parser-plugin (fn [input]
                                                         (let [output (p/elide-not-found input)]
                                                           (pprint output)
                                                           output)))
                         p/error-handler-plugin]})

Tuomas 2020-06-07T05:48:30.209800Z

I found the bug. I was querying entities on 3 levels (simplified example) [:a/id {:a/bs [:b/id {:b/cs [:c/id]}]}] for :a resolver I declared :a/bs as output, pulled the data from datomic, and renamed the :db/id keys but in addition for whatever reason I pulled the rest of the graph but didn’t rename the keys. Pulling and returning only what I was supposed to return in the :a resolver fixed the issue. It’s still unclear to me why it sometimes worked, but doesn’t really matter.

Mark Wardle 2020-06-07T08:13:39.212100Z

Hi. Is there support in pathom for federation of resolvers between providers please? I’d like to federate or hop between resolvers running on different services - is such a thing supported or does one simply create a facade and forward on each resolution request?

Mark Wardle 2020-06-07T08:14:40.212600Z

My second question is one of style. I’d like to build a set of resolvers that supports different ontologies, thus abstracting implementation details and providing graph edges and graph exploration using a standardised vocabulary - this would mean clients can walk - for example, organisations across different countries/regions without concern about underlying schema differences. For example, I’m building a graph of health and care organisations in the UK and would like to represent relationships via an ontology namespace such as https://www.w3.org/ns/prov - so that a relationship ends up being https://www.w3.org/ns/prov#wasDerivedFrom - I’m planning to use reverse URL notation in the clojure namespace to represent a particular attribute but is there a better way? For instance, this means clients can fetch the name of a given organization using :org.w3.http://www.2004.02.skos.core/prefLabel I quite like the first-class nature of naming here, but can’t use traditional URL/value tuples http://www.w3.org/2004/02/skos/core#prefLabel because that wouldn’t be a valid clojure namespace.