Fork me on GitHub
#graphql
<
2017-11-07
>
laco00:11:20

@hlship Hi, is the above also recommended way how to pass session info back to handler which executed query? I have mutation which creates user and I want to return session token which is then stored in cookie. However I want this to be transparent to client.

hlship00:11:00

Currently, the atom approach is the best way. If this keeps coming up, we may come up with a more functional alternative ... perhaps a way to add data to the :extensions key of the result map.

souenzzo02:11:08

People that are using lacinia with #datomic, how to handle with qualified keywords?

souenzzo02:11:33

It dont look's like a good idea

(deftest keywords
  (fact
    (->graphkw :foo.bar-quux/var-bar) => :foo_barQuux_varBar)
  (fact
    (->datomickw :foo_barQuux_varBar) => :foo.bar-quux/var-bar))

domkm02:11:16

Do you mean keywords as graphql scalars?

souenzzo02:11:57

What you cal scalars? I think that I want fields and enums

domkm02:11:32

Fields return objects or scalars, enums are a type of scalar.

souenzzo02:11:41

Thinking about JSON responses, {":foo/bar": ":var/quux"} will not be usefull. Not sure what I really need 😕

domkm02:11:44

You can add custom scalars, if you want to. For example, in Lacinia, you could create a schema with a scalars map like {:Keyword {:serialize pr-str :deserialize read-string}}.

domkm02:11:23

(Don't actually use read-string since that's a security issue, use a read-string function for EDN.)

domkm02:11:49

Keys in JSON are always going to be strings in GraphQL, that is not extensible.

souenzzo02:11:32

and graphql "prefer" camelSnake_case

domkm03:11:30

Well graphql tokens are roughly the same as JS so you need to abide by those rules.

domkm03:11:05

I'd suggest reading the GraphQL spec. It's quite short and understandable. http://facebook.github.io/graphql/October2016/

domkm03:11:53

To be clear, the keyword/scalar/enum/field/etc question is not related to Lacinia or Datomic specifically, just GraphQL in general.