Fork me on GitHub
#pathom
<
2019-01-04
>
pauld16:01:05

I suppose a comment about why/when you would need to set ::pc/sym. I'm wondering if there is a way to define a resolver in a different namespace than the parser. Putting other-namespace/my-mutation in the app-registry didn't seem to work. Maybe I should try :refer 'ing it into that parser's namespace instead.

pauld16:01:29

I'm going to test some things...

wilkerlucio16:01:48

@pauld the result from defresolver / defmutation is a map, so in the end you have a var containing a map, what really matters at invocation time for mutations is the ::pc/sym, on mutations you always want to set unless you want to use the mutation fully qualified name (full definition namespace + name, that's the default setting if you don't provide one), makes sense?

pauld16:01:31

yes, I think so - and the only time you don't want to use the default fully qualified name from the defmutation namespace is if you the fulcro-http-remote is looking up that defmutation via a different namespace than where the ultimate defmutation is defined and put into the registry.

pauld16:01:16

Hmm... still can't get a defmutation that is defined in another namespace to work. It's not critical, but this could cause people trouble because the fulcro book suggests separating mutations from reads and using Pathom will make them run into the same issue I had and my workaround is not the most obvious approach.

pauld16:01:00

My console gives me a transit decode error when I try this.

pauld16:01:51

I'm either doing this wrong or we need to advise people to make sure they keep their mutations (and resolvers?) definined in the same namespace as the parser. And the workaround is to def the mutation in another namespace (ie mutations.clj) if you want to use it with the fulcro-http-remote that uses mutations.clj and mutations.cljs namespaces for the api calls.

wilkerlucio16:01:02

@pauld can you send some sample code of the key points you are using? like the definition of the mutation, registry and call for it

pauld16:01:53

I have my code on github, I'll push a branch and give you the link in a bit...

pauld16:01:25

the master will be my workaround

wilkerlucio19:01:37

thanks for the repo, I'll take a look later today

pauld17:01:30

master works. pathom-broken branch is more like I wanted to do but I get a json / transit error.