Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enable introspection option to gql #29

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Change Log

## [Unreleased]
### Breaking
- Add `enable-introspection` option to Lacinia component. If you want to enable introspection, you need to set `enable-introspection` to `true` explicitly.

## 0.3.195
### Changed
Expand Down
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
Loading