Hello all, can I use field names with "-" instead of "_"?
in lacinia?
I don’t think so, IIRC it’s prohibited by GraphQL spec
http://spec.graphql.org/June2018/#sec-Appendix-Grammar-Summary.Lexical-Tokens
Name
/[_A-Za-z][_0-9A-Za-z]*/
(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?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?