Repository: wilkerlucio/pathom (clojure)

Issue:
::p/reader-error instead of ::p/not-found for transitive resolvers
In this case

```clojure
(defresolver test-x [_ _]
  {::pc/input  #{}
   ::pc/output [:x]}
  {})
(defresolver test-y [_ _]
  {::pc/input  #{:x}
   ::pc/output [:y]}
  {:y true})
```

`(parser {} [:y])` with `reader2` returns `{:y ::p/reader-error}` instead of `{:y ::p/not-found}`, while parser with `parallel-reader` returns what's expected.

Quick repro (v2.2.28):
```clojure
(let [register [(pc/resolver `x1
                             {::pc/output [:x1]}
                             (fn [env input] {:x1 nil}))
                (pc/resolver `x2
                             {::pc/output [:x2]}
                             (fn [env input] {}))
                (pc/resolver `y1
                             {::pc/input  #{:x1}
                              ::pc/output [:y1]}
                             (fn [env {:keys [x1]}] {:y1 (pr-str x1)}))
                (pc/resolver `y2
                             {::pc/input  #{:x2}
                              ::pc/output [:y2]}
                             (fn [env {:keys [x2]}] {:y2 (pr-str x2)}))]
      parser (p/parallel-parser {::p/plugins [(pc/connect-plugin {::pc/register register})
                                              p/error-handler-plugin]})
      env {::p/reader [p/map-reader
                       pc/reader2
                       pc/open-ident-reader]}]
  (async/<!! (parser env [:y1 :y2])))
```

Output:
```clojure
{:y1 "nil",
 :y2 :com.wsscode.pathom.core/reader-error,
 :com.wsscode.pathom.core/errors {[:y2] "class clojure.lang.ExceptionInfo: Insufficient resolver output - {:com.wsscode.pathom.parser/response-value {}, :key :x2}"}}
```

Pull request:
Closes #137

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5a9cd99a..e9bf4847 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
 # Change Log
 
+## [2.2.29]
+- `pc/reader2` will return `::p/not-found` instead of an error when dependency links are missing
+
 ## [2.2.28]
 - Fix bounded recursion on parallel parser
 - Connect mutations add ::pc/mutation-ast to the env
diff --git a/src/com/wsscode/pathom/connect.cljc b/src/com/wsscode/pathom/connect.cljc
index 3bdfcf47..27a6a3d9 100644
--- a/src/com/wsscode/pathom/connect.cljc
+++ b/src/com/wsscode/pathom/connect.cljc
@@ -898,7 +898,8 @@
                   (if-let [[plan failed-resolvers out'] (replan (ex-info "Insufficient resolver output" {::pp/response-value response :key key'}))]
                     (recur plan failed-resolvers out')
                     (do
-                      (if (seq tail)
+                      (if (and (seq tail)
+                               (p/break-values (get response key')))
                         (throw (ex-info "Insufficient resolver output" {::pp/response-value response :key key'})))
 
                       (process-simple-reader-response env' response)))))


Test patch:
diff --git a/test/com/wsscode/pathom/connect_test.cljc b/test/com/wsscode/pathom/connect_test.cljc
index 46e96a30..637311db 100644
--- a/test/com/wsscode/pathom/connect_test.cljc
+++ b/test/com/wsscode/pathom/connect_test.cljc
@@ -3280,25 +3280,35 @@
        (reset! quick-parser-trace* @trace)
        res)))
 
-#?(:clj
-   (defn quick-parser-serial [{::p/keys  [env]
-                               ::pc/keys [register]} query]
-     (let [trace  (atom [])
-           parser (p/parser {::p/env     (merge {::p/reader               [p/map-reader
-                                                                           pc/reader2
-                                                                           pc/open-ident-reader
-                                                                           p/env-placeholder-reader]
-                                                 ::pt/trace*              trace
-                                                 ::p/placeholder-prefixes #{">"}}
-                                                env)
-                             ::p/mutate  pc/mutate
-                             ::p/plugins [(pc/connect-plugin {::pc/register register})
-                                          p/error-handler-plugin
-                                          p/request-cache-plugin
-                                          p/trace-plugin]})
-           res    (parser {} query)]
-       (reset! quick-parser-trace* @trace)
-       res)))
+(defn quick-parser-serial [{::p/keys  [env]
+                            ::pc/keys [register]} query]
+  (let [trace  (atom [])
+        parser (p/parser {::p/env     (merge {::p/reader               [p/map-reader
+                                                                        pc/reader2
+                                                                        pc/open-ident-reader
+                                                                        p/env-placeholder-reader]
+                                              ::pt/trace*              trace
+                                              ::p/placeholder-prefixes #{">"}}
+                                             env)
+                          ::p/mutate  pc/mutate
+                          ::p/plugins [(pc/connect-plugin {::pc/register register})
+                                       p/error-handler-plugin
+                                       p/request-cache-plugin
+                                       p/trace-plugin]})
+        res    (parser {} query)]
+    (reset! quick-parser-trace* @trace)
+    res))
+
+(deftest test-serial-parser-reader2
+  (is (= (quick-parser-serial {::pc/register [(pc/resolver 'x
+                                                {::pc/output [:x]}
+                                                (fn [_ _] {}))
+                                              (pc/resolver 'y
+                                                {::pc/input  #{:x}
+                                                 ::pc/output [:y]}
+                                                (fn [_ _] {:y true}))]}
+           [:y])
+         {:y ::p/not-found})))
 
 #?(:clj
    (deftest test-parallel-parser-with-connect