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

Precompile and Lazy Schema Compilation #8

Open
bnert opened this issue Jan 14, 2024 · 0 comments
Open

Precompile and Lazy Schema Compilation #8

bnert opened this issue Jan 14, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bnert
Copy link
Contributor

bnert commented Jan 14, 2024

A pattern I've landed on w/ multiple handlers is to have:

(def kit-config
  {:graphql.kit/engine "..."})

(def http-handler (kit.http/handler kit-config))
(def ws-handler (kit.ws/handler kit-config))
(def graphiql-handler (kit.graphiql/handler {:enabled? true, #_...})

In order to not perform extra work, it'd be good to allow for eager and/or lazy compilation:

(def kit-config
  (kit.util/precompile
    {:graphql.kit/engine "..."}))

; or for lazy, but single compilation. Basically would be: `(lazy (kit.util/precompile ...))`.
#_(def kit-config
  (kit.util/lazy-compile
    {:graphql.kit/engine "..."}))

(def http-handler (kit.http/handler kit-config))
(def ws-handler (kit.ws/handler kit-config))
(def graphiql-handler (kit.graphiql/handler {:enabled? true, #_...})
@bnert bnert added the enhancement New feature or request label Jan 14, 2024
@bnert bnert self-assigned this Jan 14, 2024
@bnert bnert changed the title Precompile Schema/Config Precompile and Lazy Schema Compilation Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant