This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-25
Channels
- # beginners (33)
- # cider (40)
- # clara (28)
- # cljs-dev (38)
- # cljsrn (5)
- # clojure (197)
- # clojure-greece (1)
- # clojure-italy (7)
- # clojure-losangeles (1)
- # clojure-nl (10)
- # clojure-spec (32)
- # clojure-uk (154)
- # clojurescript (48)
- # core-async (33)
- # cursive (32)
- # datomic (19)
- # duct (1)
- # fulcro (10)
- # graphql (6)
- # jobs (1)
- # lumo (1)
- # mount (6)
- # off-topic (48)
- # onyx (12)
- # other-languages (2)
- # re-frame (77)
- # reagent (19)
- # reitit (4)
- # ring (5)
- # ring-swagger (18)
- # rum (4)
- # shadow-cljs (52)
- # specter (12)
- # tools-deps (47)
I have a graphql server which only has Query, and right now all it does is essentially translate graphql query string to sql query string, and run the query with very minimal transformation/computation in between.
i can only think of to populate the test db with some sample data, than run 1~2 query through api and verify it works as expected, but i feel like that's not testing much here.
my resolver function is pretty generic as well, one looks like:
(defn query-entities
[{:keys [x-user-id db] :as context}
{:keys [filter orderBy first skip] :as args}
{:keys [uuid] :as value}]
(let [constraints (merge filter
{:user-id x-user-id}
(when uuid
{:import-uuid uuid}))
query-configs (select-keys args [:orderBy :first :skip])]
(db/query-all-from-table db :entities query-configs)))