This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-15
Channels
- # aleph (14)
- # aws (5)
- # beginners (144)
- # bitcoin (1)
- # boot (14)
- # chestnut (13)
- # cljs-dev (58)
- # cljs-experience (1)
- # cljsrn (47)
- # clojure (107)
- # clojure-dev (9)
- # clojure-finland (12)
- # clojure-gamedev (4)
- # clojure-russia (2)
- # clojure-sanfrancisco (1)
- # clojure-spec (5)
- # clojure-uk (28)
- # clojurescript (34)
- # cursive (9)
- # datomic (3)
- # emacs (11)
- # garden (16)
- # graphql (9)
- # hoplon (3)
- # jobs (2)
- # juxt (6)
- # off-topic (32)
- # om (10)
- # onyx (1)
- # pedestal (4)
- # proton (1)
- # re-frame (14)
- # reagent (8)
- # ring (1)
- # ring-swagger (34)
- # shadow-cljs (19)
- # sioux-falls (1)
- # spacemacs (16)
- # testing (14)
In the lacinia schema (EDN file), is there a way to have enums as already defined keywords in the code somewhere and import them in the schema? I feel like it’s so error prone to have a text mapping for enums. In our schema, we have a lot of values for multiple enums and it feel really cumbersome.
Well, you can specify enums as strings, keywords, or symbols --- internally they are always represented as keywords.
Remember that you read the EDN file, then compile it ... it is totally expected that you could assoc-in
additional data between those steps.
I like the way you think, @U04VDKC4G! 😄
I think it's good design, but it was already in place before I did any work on Lacinia. @U3DJ4E4C9 should be thanked for establishing for the schema-as-EDN approach, which just works so well with the Clojure ethic and ecosystem.
Added a new util almost copied from lacinia-util/attach-resolvers
which gives:
(edn-utils/replace-enum-values {:resolve-tension-trend-values capabilities-service/tension-trends})