Skip to content

Commit

Permalink
Add enable-introspection option to Lacinia component
Browse files Browse the repository at this point in the history
  • Loading branch information
egs33 committed Dec 5, 2024
1 parent 728689b commit 9076f19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/toyokumo/commons/experimental/graphql/lacinia.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
[com.walmartlabs.lacinia.schema :as l.schema]
[com.walmartlabs.lacinia.util :as l.util]))

(defrecord Lacinia [sdl-path resolver compiled-schema]
(defrecord Lacinia [sdl-path enable-introspection? resolver compiled-schema]
component/Lifecycle
(start [this]
(if-let [sdl (io/resource sdl-path)]
(-> sdl
slurp
l.parser.schema/parse-schema
(l.util/inject-resolvers (:resolvers resolver))
l.schema/compile
(l.schema/compile {:enable-introspection? (boolean enable-introspection?)})
(->> (assoc this :compiled-schema)))
(throw (IllegalArgumentException. (str "Schema Definition Language file can not find in " sdl-path)))))
(stop [this]
Expand Down

0 comments on commit 9076f19

Please sign in to comment.