This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-21
Channels
- # beginners (82)
- # bitcoin (1)
- # boot (38)
- # cider (6)
- # cljs-dev (13)
- # cljsrn (5)
- # clojure (320)
- # clojure-italy (22)
- # clojure-losangeles (6)
- # clojure-russia (55)
- # clojure-spec (25)
- # clojure-uk (48)
- # clojurescript (64)
- # component (16)
- # core-async (6)
- # cursive (54)
- # data-science (2)
- # datascript (2)
- # datomic (8)
- # docker (1)
- # ethereum (1)
- # fulcro (1)
- # garden (1)
- # graphql (16)
- # heroku (6)
- # hoplon (12)
- # jobs (4)
- # juxt (1)
- # leiningen (9)
- # off-topic (39)
- # om (13)
- # om-next (2)
- # onyx (9)
- # pedestal (2)
- # portkey (12)
- # re-frame (25)
- # reagent (6)
- # ring-swagger (4)
- # schema (1)
- # shadow-cljs (10)
- # spacemacs (11)
- # testing (19)
- # uncomplicate (1)
- # unrepl (6)
- # vim (21)
- # yada (3)
@hmaurer currently what we're doing is declaring the lacinia schema with :objects
and generating mutations and queries based on that schema. We annotate the schema with some extra information to configure the resolvers. Mutations are create/update with arbitrary nesting (depending on which side the relations are managed in datomic) and delete. Queries are by-id and search by object type. We declare in the objects which fields are searchable and generate input-object by type (e.g. date fields you can query with before
and after
, string with contains
equals
startswith
etc).
I think though that it's possible to store the information for generating the entire lacinia schema in datomic by annotating the datomic schema, but I have to think about it some more
For mutations we have 2 steps that are performed on the input: transformation on the peer (e.g. get extra information from other services, in our case google places api), validation with database functions at the transactor. This is all based on data declaration in the schema, so the code for the resolvers is generic
@hmaurer I got that message yesterday. It was an issue with casing the field, took me a while to hunt down (damn automatic camel casing)
@stijn oh, I am doing something very similar, especially with regard to allowing nested creates
@stijn I took the approach of generating the Lacinia schema from the Datomic schema + some extra config map