Skip to content

Commit

Permalink
Merge pull request #388 from walmartlabs/hls/fix-resolve-as
Browse files Browse the repository at this point in the history
Fix resolve-as with nil error returning nil (in 1.1-alpha-4)
  • Loading branch information
hlship committed Nov 2, 2021
2 parents 0255a91 + c779934 commit e483dfc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/com/walmartlabs/lacinia/resolve.clj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
(reduce #(wrap-value %1 behavior (assert-error-map %2)) value (reverse error))

(some? error)
(wrap-value value behavior (assert-error-map error))))
(wrap-value value behavior (assert-error-map error))
(wrap-value value behavior (assert-error-map error))

:else
value))

(defn with-error
"Wraps a value, modifying it to include an error map.
Expand Down
6 changes: 5 additions & 1 deletion test/com/walmartlabs/lacinia/resolver_errors_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,8 @@
:line 1}]
:message "Error processing request"
:path [:hello]}]}
(execute schema "{ hello }")))))
(execute schema "{ hello }")))))

(deftest with-error-nil
(is (= ::value
(with-error ::value nil))))

0 comments on commit e483dfc

Please sign in to comment.