This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-24
Channels
- # announcements (12)
- # aws (11)
- # babashka (1)
- # beginners (73)
- # cider (4)
- # clj-kondo (2)
- # cljsrn (4)
- # clojars (2)
- # clojure (68)
- # clojure-europe (8)
- # clojure-nl (5)
- # clojure-spec (6)
- # clojure-sweden (1)
- # clojure-uk (29)
- # clojurescript (41)
- # conjure (22)
- # datomic (33)
- # docker (58)
- # duct (3)
- # emacs (8)
- # events (1)
- # expound (3)
- # figwheel-main (5)
- # fulcro (33)
- # graphql (2)
- # kaocha (2)
- # lambdaisland (39)
- # leiningen (1)
- # nrepl (49)
- # nyc (1)
- # off-topic (77)
- # pathom (1)
- # re-frame (33)
- # reagent (28)
- # reitit (1)
- # rewrite-clj (2)
- # shadow-cljs (195)
- # spacemacs (1)
- # sql (60)
- # tools-deps (13)
- # vim (18)
- # xtdb (46)
I have a schema that looks like
{:queries {:orb {:type Orb
:args {:name {:type String}}
:resolve :orb}}
:objects {:Orb {:id {:type (non-null ID)}, ...}}}
But if I make a query to orb
like so:
orb(name: $name) {
id
}
and my resolver returns nil
instead of a map, I get this error:
[{"message":"Non-nullable field was null.","locations":[{"line":4,"column":5}],"path":["orb","id"]}]
I assumed that if the query response itself was nullable, even though one of the inner fields I’m querying over is non-nullable, I could return a null instead of the entire object and that would be legit. Am I misunderstanding how GraphQL works?