Fork me on GitHub
#pathom
<
2022-07-23
>
Quentin Le Guennec08:07:50

Hello. In Pathom 2, how can I get a join in a resolver input?

souenzzo17:07:09

if you are expecting nested inputs, it is only available in pathom3 https://pathom3.wsscode.com/docs/resolvers/#nested-inputs

sheluchin12:07:48

What is the difference between :com.wsscode.pathom3.error/attribute-missing and :com.wsscode.pathom3.error/missing-output? The https://pathom3.wsscode.com/docs/error-handling/#attribute-missing-on-output only include an entry for the first one. > This happens when the resolver completed with success, but the output didn't include the attribute.

souenzzo12:07:33

About missing-output:

(let [a (pco/resolver `a
          {::pco/output [:a]}
          (fn [_ _]
            ;; :com.wsscode.pathom3.error/missing-output
            ;; when a resolver say that it will return :a, but dont
            {}))
      env (pci/register [a])]
  (try
    (p.eql/process env [:a])
    (catch Throwable ex
      (:com.wsscode.pathom3.error/cause (:com.wsscode.pathom3.error/error-data (ex-data ex))))))
  

sheluchin12:07:46

@U2J4FRT2T that sounds the same as "output didn't include the attribute", no? What bit of nuance am I missing?

sheluchin12:07:38

Is it for when the whole output is missing?

souenzzo12:07:39

I'm trying to create a :com.wsscode.pathom3.error/attribute-missing error in my repl

wilkerlucio18:08:16

they work at different times, attribute missing is more broad, means attribute was expected by query, but wasn't there, this check runs after the graph is done for given entity, makes sense?

sheluchin18:08:16

@U066U8JQJ so attribute-missing can happen during the graph traversal, whereas missing-output only happens at the end?

wilkerlucio18:08:31

humm, I'm doing a double check reading the code, I'm starting to think one of them might not happen, because they are in the two different places, aparently for the same reason

wilkerlucio18:08:45

I can't go deep check now, but I'll open an issue to clear this up

sheluchin18:08:47

Okay, thank you. I do believe I've actually encountered both errors during development, but I don't have a repro at the moment.. I could be mistaken. If it comes up again I will document it somewhere and leave a link here.