This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-02
Channels
- # beginners (98)
- # bigdata (1)
- # bitcoin (1)
- # boot (32)
- # cider (20)
- # cljs-dev (57)
- # cljsrn (130)
- # clojure (93)
- # clojure-dusseldorf (1)
- # clojure-germany (1)
- # clojure-greece (3)
- # clojure-italy (2)
- # clojure-russia (203)
- # clojure-spec (14)
- # clojure-uk (50)
- # clojurescript (127)
- # css (7)
- # cursive (6)
- # data-science (1)
- # datomic (4)
- # emacs (1)
- # events (1)
- # fulcro (8)
- # funcool (12)
- # graphql (7)
- # jobs (1)
- # lein-figwheel (2)
- # luminus (2)
- # off-topic (7)
- # om (16)
- # onyx (4)
- # parinfer (17)
- # pedestal (6)
- # portkey (36)
- # proton (3)
- # re-frame (10)
- # shadow-cljs (140)
- # spacemacs (12)
- # specter (1)
- # sql (1)
- # vim (10)
- # yada (10)
I know there’s not much context here other than I’m using a union. Could someone help me understand what "Field resolver returned an instance not tagged with a schema type."
means?
@amar i’m guessing you need to wrap your sub-types in a
... on union_type {
compare these two tests:
https://github.com/walmartlabs/lacinia/blob/dd7161137cc7464670eccdf85edf5bc4a5b15fde/test/com/walmartlabs/lacinia/unions_test.clj#L64-L87Thanks @sashton. I do have that except it is an explicit fragment (using venia). I might have to create a separate repo for context otherwise it will be difficult to diagnose. Do appreciate your response!
That test did help point out schema/tag-with-type
. Looks like I need to call that function on the map.
Right; when a field resolves to a union or interface type, it is up to the resolver function to tag the result with its actual type. Lacinia doesn't have a way to do that on its own, and it needs the type information. In most cases, where a field resolves to a concrete object type, Lacinia does the tagging automatically.
@hlship and @sashton Thanks for your help. I wasn’t calling schema/tag-with-type
. It works now.
We should update http://lacinia.readthedocs.io/en/latest/unions.html and http://lacinia.readthedocs.io/en/latest/interfaces.html to call out that you need to use schema/tag-with-type
.