This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-16
Channels
- # announcements (7)
- # asami (31)
- # aws (9)
- # babashka (29)
- # bangalore-clj (8)
- # beginners (153)
- # calva (4)
- # cider (21)
- # clj-kondo (29)
- # clojure (78)
- # clojure-australia (2)
- # clojure-dev (63)
- # clojure-europe (22)
- # clojure-italy (7)
- # clojure-nl (3)
- # clojure-norway (4)
- # clojure-uk (25)
- # core-async (1)
- # cursive (24)
- # datomic (33)
- # emacs (15)
- # events (2)
- # fulcro (4)
- # girouette (1)
- # google-cloud (2)
- # graphql (14)
- # honeysql (15)
- # instaparse (1)
- # jobs (2)
- # jobs-discuss (2)
- # meander (18)
- # off-topic (100)
- # pathom (48)
- # pedestal (2)
- # polylith (5)
- # practicalli (4)
- # reveal (8)
- # shadow-cljs (3)
- # spacemacs (12)
- # sql (23)
- # tools-deps (1)
- # uncomplicate (1)
- # vim (21)
- # xtdb (19)
(defn hyphenating-default-field-resolver
"An alternative to [[default-field-resolver]], this converts underscores in the field name
into hyphens. At one time, this was the default behavior."
{:added "0.17.0"}
[field-name]
(-> field-name
name
(str/replace "_" "-")
keyword
default-field-resolver))
what is it means? Can I use with '-' and it change after?This is a mapping between the names of the GraphQL fields (“a_name_like_this”) and the keyword keys of the maps being selected (:a-name-like-this).
Otherwise, if you want snake-case names in your GraphQL you have to provide an explicit resolver for every single field, no matter how trivial.
You can customise the default resolver in your compile call: https://walmartlabs.github.io/apidocs/lacinia/com.walmartlabs.lacinia.schema.html#var-compile . Meaning that you can automatically convert between underscores and hyphens. That said, the convention I see most in GraphQL endpoints is actually camelCase
, not snake_case
.
I tried upgrading lacinia-pedestal
to 0.15.0 from 0.12.0, making use of the 'new' pedestal2/default-service
. But to no success. Does the compiled-schema also need to look different? Does someone maybe know of an example project using 0.15.0?
Specifically it goes wrong when trying to run aot compiled from docker. When run locally with lein run
it does work.
So now I've found a way to create a uberjar without aot all. And when running the jar loccaly it works. But when running the jar in docker it seems like it's not doing anything. Maybe I need to set the hostname?
What is “it goes wrong”? Does the service not start? Does it not handle requests? Is there some issue with the mapping of the container’s port to a host port?
It did not handle the request, and was indeed the hostname I had to change. https://github.com/gklijs/bob2021 is all updated and aside from the docs ready for BOB the 26th. I might also send a pr to change ‘my’ demo project in the lacinia from open-bank-mark to this.