Fork me on GitHub
#pathom
<
2022-03-09
>
yenda07:03:44

the docs mentions consuming graphql, but is there any plan in the future to do the other way around (propose a graphql endpoint?). my understanding is that it may be even "easier" as graphql schemas define strict entry points to the graph through queries and mutations

jmayaalv09:03:58

i experimented with this a bit and would like to go back to it soon. there is an ongoing discussion here https://github.com/wilkerlucio/pathom3/discussions/18 and some beginnings here https://github.com/jmayaalv/graffito/

aratare09:03:33

Hi there, I'm currently using Pathom along with Fulcro and would love to get more into the REPL way of working. One thing that alludes me is how to test out mutations and resolvers against the parser. For example, let's say I have a mutation called login that takes a username and password as its args, what sort of code do I need to write where I can send it to the REPL to see the mutation code in action? Thanks in advance.

wilkerlucio14:03:49

the most accurate way to test is to call the parser directly and send your mutation there, this way you make sure you running with all the plugins and etc

wilkerlucio14:03:35

if you still want to call the mutation in isolation, you can grab the function via ::pc/mutate in the mutation, that key has the function with 2 arguments (env and params) to call the mutation directly

wilkerlucio14:03:43

I'm assuming you are asking about Pathom 2

wilkerlucio14:03:01

in Pathom 3 both mutations and resolvers are custom types that implement IFn, so you can call those directly

aratare14:03:39

Hey. Yes I'm using pathom2 at the moment (because Fulcro). Seems like calling the parser directly is the way I want since I want to test out the entire thing (i.e. request comes in responses goes out). Thanks a lot 😄

nivekuil04:03:00

fulcro works just fine with pathom3 btw

1
pithyless17:03:50

Anyone ever see an error like this?

1. Caused by java.lang.AbstractMethodError
   Method
   com/wsscode/pathom3/connect/operation/Mutation.applyTo(Lclojure/lang/ISeq;)Ljava/lang/Object;
   is abstract
This showed up when I had something like this:
(comment
  (def foo (my.app.mutations/some-mutation {:my :env} {:my :input})))
So, calling the mutation directly as a function and trying to bind it to a def. If I instead used (defn foo [] ...) and then (def foo2 (foo)) everything worked fine.

wilkerlucio18:03:08

that's strange, never seen that before

Tommy17:02:50

I just got this as well. The def works inside of the function, but not when called directly from repl..

Tommy16:02:23

It may have something to do with moun or clojure.tools.namespace.repl. I am using this script https://github.com/fulcrologic/fulcro-template/blob/master/src/dev/development.clj

Tommy16:02:02

I think its a reloading thing because it only breaks on a minority of functions, while other ones work perfectly