Fork me on GitHub
#pathom
<
2020-12-11
>
dehli00:12:48

Another question, is it common/encouraged to have system only resolvers? I have some system states that I’m thinking could be easier to debug/dev if they were represented with resolvers but then i’d need to prevent clients from requesting them directly. One idea i’m running through is having a resolver that returns the database model and then downstream resolvers could take the database model and convert to the application model

souenzzo00:12:15

I have resolvers that returns db schema, jvm startup data and I'm working//planning resolvers that returns my #pedestal routes and many more (use pathom as a "startup/component" system) For my API, I just filter some keys

dehli00:12:16

thanks! ya it seems like fully embracing pathom is very powerful

souenzzo00:12:54

It's hard to code without pathom after use it for a while

🙂 3
Aleed15:12:04

with pathom3, what’s the correct way to set data (like a db connection) on env context?

Aleed15:12:33

ah I see that smart maps and eql process both take initial data

Aleed15:12:55

was trying to use the built-in resolvers at first 😅

Aleed15:12:10

@U066U8JQJ seems like initial data is not passed to data map argument that mutations take? For arity two, inspecting env context I do see the initial data, but not sure which way I’m supposed to be accessing it.

wilkerlucio15:12:11

when create Smart Maps or EQL trigger, the first argument is the env, you should set the db connection there, same for mutations

wilkerlucio15:12:33

like: (psm/smart-map (assoc env ::my-db ...) {:my.customer/id "123"})

Aleed15:12:40

so pathom-indexes/register creates an env (not just indexes), and we can assoc additional env values into it before calling smart-map or eql process

Aleed15:12:42

i’m trying this

(pathom-eql/process
   (assoc indexes
          ::ctx/conn (dc/conn))
   eql))
but assoc’ed data does not seem to be included in map passed to mutations

wilkerlucio15:12:31

there are two maps, the env and params

Aleed15:12:38

hm i guess i have to use arity two to access it

wilkerlucio15:12:40

to use env you need to declare the mutation with both

Aleed15:12:54

^ yeah, i thought since everything was namespaced it’d be in one map

wilkerlucio16:12:02

(pco/defmutation mmmm [env params])

wilkerlucio16:12:12

nope, two different contexts of information

👍 3
wilkerlucio20:12:08

parts of Pathom Viz integrated in Reveal

jmayaalv20:12:43

This is awesome!! :star-struck::star-struck::star-struck: