Skip to content

Commit

Permalink
Fix the message on distinct missing inputs error
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkerlucio committed Dec 18, 2024
1 parent b0a7363 commit 730f9d5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/com/wsscode/pathom3/connect/runner.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,12 @@
(not (contains? @node-run-stats* node-id))))

(defn input-missing-error-message-leaf [nodes attr]
(if (> (count nodes) 1)
(str "- Attribute " attr " was expected to be returned from resolvers "
(str/join ", " (sort (distinct (map ::pco/op-name nodes))))
" but all of them failed to provide it.")
(str "- Attribute " attr " was expected to be returned from resolver " (::pco/op-name (first nodes)) " but it failed to provide it.")))
(let [resolvers (sort (distinct (map ::pco/op-name nodes)))]
(if (> (count resolvers) 1)
(str "- Attribute " attr " was expected to be returned from resolvers "
(str/join ", " resolvers)
" but all of them failed to provide it.")
(str "- Attribute " attr " was expected to be returned from resolver " (::pco/op-name (first nodes)) " but it failed to provide it."))))

(defn input-missing-error-message [env node attr]
(if (node-failed-due-to-missing-inputs? env node)
Expand Down

0 comments on commit 730f9d5

Please sign in to comment.