Skip to content

Commit

Permalink
add test for resolvables returning an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Scherer committed Apr 20, 2017
1 parent 5b4495b commit fa97e77
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/alumbra/claro_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
type HouseDog implements Pet { name: String!, owner: Person!, barkVolume: Int }
type Cat implements Pet { name: String!, meowVolume: Int }
type Dog implements Pet { name: String!, barkVolume: Int }
type QueryRoot { me: Person!, allPeople: [Person!] }
type QueryRoot { me: Person!, allPeople: [Person!], error: Boolean }
schema { query: QueryRoot }"))

;; ## Test Resolvables
Expand Down Expand Up @@ -70,8 +70,15 @@
(resolve! [_ _]
((rand-nth [->Cat ->Dog]) name)))

(defrecord SomeError []
data/PureResolvable
data/Resolvable
(resolve! [_ _]
(data/error "some error.")))

(def QueryRoot
{:me (->Person "Me")
:error (->SomeError)
:all-people (->AllPeople)})

;; ## Tests
Expand Down

0 comments on commit fa97e77

Please sign in to comment.