Skip to content

Commit

Permalink
assert that the schema is valid, i.e. does not represent a parser error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Scherer committed Mar 10, 2017
1 parent 08ea14a commit 01f95ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/alumbra/claro.clj
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,17 @@

;; ## Options

(defn- assert-schema-valid
[schema]
(assert (not (contains? schema :alumbra/parser-errors))
(str "schema not valid (parser error): "
(pr-str schema))))

(defn- prepare-opts
[{:keys [wrap-key-fn schema]
:or {wrap-key-fn identity}
:as opts}]
(assert-schema-valid schema)
(-> opts
(assoc :key-fn (wrap-key-fn keys/generate-key))
(update :query add-introspection-resolvables schema)
Expand Down

0 comments on commit 01f95ac

Please sign in to comment.