This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (13)
- # announcements (2)
- # asami (59)
- # babashka (6)
- # beginners (273)
- # calva (18)
- # cider (3)
- # cljs-dev (3)
- # clojure (84)
- # clojure-estonia (1)
- # clojure-europe (2)
- # clojure-france (11)
- # clojure-nl (3)
- # clojure-taiwan (2)
- # clojure-uk (23)
- # clojurescript (7)
- # code-reviews (321)
- # conjure (4)
- # data-science (1)
- # depstar (6)
- # fulcro (37)
- # helix (20)
- # juxt (3)
- # keechma (3)
- # leiningen (3)
- # malli (7)
- # nrepl (1)
- # off-topic (20)
- # pathom (25)
- # re-frame (30)
- # reveal (5)
- # shadow-cljs (25)
- # sql (15)
- # tools-deps (4)
- # uncomplicate (2)
- # xtdb (3)
@wilkerlucio I've just read the docs for pathom 3. Would the plugin system allow me to add resolvers based on a spec? For example with rest apis I am doing the same operations over and over. I'd like to take the api spec, usually in json, then generate resolvers automatically. I'm already generating quite a few functions at compile time to make it easier on myself. I just wonder if spending the next month on this would be wasted, because I don't really understand the plugins from the existing docs, and am still a beginner with clojure. My question is would the plugin architecture be the place to start, or should I write it as a library?
for that you don't need plugins, plugins are for hooking inside pathom operations as they occur, the generation of resolvers is something you can do ahead of time, and then register them, so you don't need plugins for that, makes sense?
Yes, thanks, so I write the library, and just register the generated resolvers and it should work...
yup, your library can for example take some input specs (in open api or something) and return a vector of resolvers
than the user register it, something like:
(pci/register (api-wrapper/create-resolvers some-api-spec))
what kind of specs are wrapping?
I'm wanting to add a few more, and going back over my code there is a lot of repetion. I am kinda wanting to make a generic rest library to wire in any kind of rest api. It's barely an idea at this point but it beats writing the same functions over and over.
its on my backlog to have a library to support the Open API protocol
so, if I got right, you are manually doing it per api type? (like service)
It seems the hard part is authentication, once I have that, doing post,get,patch,etc is easy.
I also guess the naming translations can be challenging
to make sure everything is correctly identified
I suggest doing some sort of prefix (like Pathom 2 does for GraphQL) in order to enable better integration without entity name collision (when handling many different services)
Interesting discussion. @UAB2NMK25 - take a look at this: https://vvvvalvalval.github.io/posts/2018-07-23-datascript-as-a-lingua-franca-for-domain-modeling.html Looks like he lays an approach to what you try to achieve. Hopefully you'll find it useful.
@U015R6SQ77Z Thanks, that is an awesome article, and gave me a few ideas
I found that too which looks like it does exactly what I wanted but I cannot seem to get it to work against http://swapi.dev as a test