This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-25
Channels
- # aws (10)
- # babashka (4)
- # beginners (103)
- # calva (19)
- # chlorine-clover (2)
- # cider (10)
- # cljs-dev (23)
- # cljsrn (6)
- # clojure (145)
- # clojure-europe (17)
- # clojure-nl (1)
- # clojure-spec (11)
- # clojure-uk (4)
- # clojurescript (64)
- # conjure (11)
- # core-async (19)
- # cursive (38)
- # datomic (4)
- # duct (2)
- # fulcro (51)
- # helix (11)
- # joker (1)
- # kaocha (7)
- # leiningen (3)
- # malli (5)
- # meander (3)
- # off-topic (12)
- # pathom (17)
- # pedestal (2)
- # re-frame (27)
- # rum (11)
- # shadow-cljs (77)
- # xtdb (9)
- # yada (1)
I have a pathom client that speaks json and I'd rather not have to get it to speak edn. Does anyone know of a json form of eql that has a straightforward translation to eql?
I'm particularly concerned about representing idents and eql parameters.
what do you mean by "pathom client that speaks json"?
I have a lib called eql-as
that I use for it.
Checkout "RealWorld" example
In the product that I work on, we use to map a REST API, with unqualified keys, both GET and POST's to EQL queries then dispatch it for a parser
that only knows about qualified keys
https://github.com/souenzzo/eql-as
I mean, my client is a typical browser-based javascript application. I want it to make queries that would be resolved by my pathom server-side application
@U2J4FRT2T Thanks! The library looks like it will be helpful after I come up with a json syntax for eql. My challenge right now is to come up with that syntax! 🙂
I want to create an async version of this parser so it can run under nodejs https://github.com/walkable-server/walkable/blob/3b1c218ef60c90b7a79f968c87e2ee0af46608b3/dev/src/common/walkable/integration_test/helper.clj#L27
it uses planner, btw
what do i have to change beside the dynamic resolver function?
eg: change p/parser to p/parallel-parser, pc/reader3 to something...
It looks like pathom does an outer join when the results of two resolvers are joined together. Is there a way to get it to do an inner join instead?
not sure what you mean, can you give an example?
(ns com.wsscode.pathom.book.connect.getting-started2
(:require [com.wsscode.pathom.core :as p]
[com.wsscode.pathom.connect :as pc]))
(pc/defresolver people-resolver [_ _]
{::pc/input #{}
::pc/output [{:people [:name]}]}
{:people [{:name "Mark"}
{:name "Joe"}]})
(pc/defresolver address-resolver [_ {:keys [name]}]
{::pc/input #{:name}
::pc/output [:address]}
(if (= name "Mark")
{:address "111 Main St"}))
(def app-registry [people-resolver
address-resolver
pc/index-explorer-resolver])
(def parser
(p/parser
{::p/env {::p/reader [p/map-reader
pc/reader2
pc/open-ident-reader]}
::p/mutate pc/mutate
::p/plugins [(pc/connect-plugin {::pc/register app-registry})
p/error-handler-plugin
p/trace-plugin]}))
(parser {} [{:people [:name :address]}])
The result is
{:people [{:name "Mark", :address "111 Main St"} {:name "Joe", :address :com.wsscode.pathom.core/not-found}]}
I'd like to filter out JoeI suspect that I have to write a plugin to do this. Am I on the right track?
After looking at the plugin architecture, I think that's the wrong approach. Perhaps post-processing the results is the right way