This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-21
Channels
- # admin-announcements (1)
- # announcements (6)
- # babashka (8)
- # beginners (134)
- # calva (18)
- # chlorine-clover (1)
- # cider (6)
- # circleci (6)
- # clj-commons (111)
- # cljsrn (13)
- # clojure (95)
- # clojure-australia (2)
- # clojure-europe (15)
- # clojure-nl (1)
- # clojure-spec (52)
- # clojure-uk (17)
- # clojurescript (4)
- # datavis (9)
- # datomic (8)
- # docker (2)
- # emacs (15)
- # events (7)
- # fulcro (6)
- # graphql (1)
- # gratitude (1)
- # introduce-yourself (2)
- # kaocha (8)
- # meander (87)
- # minecraft (2)
- # music (2)
- # off-topic (20)
- # portal (119)
- # releases (1)
- # reveal (55)
- # shadow-cljs (34)
- # sql (36)
- # tools-deps (9)
- # vim (8)
- # xtdb (39)
@tony.kay Given the db with a "loose edge":
{:current-locale [:locale :en]}
And the query:
(defsc Locale [_ _]
{:query [:locale :translations]
:ident :locale})
(defsc Root [_ props]
{:query [{:current-locale (comp/get-query Locale)}]}
(:current-locale props))
This gives me the [:locale :en]
although I expected nil
. Like I would if I did (get-in db [:locale :en])
Is there a reason for this behavior? Fulcro knows [:locale :en]
isn't "real data" based on the ident of Locale
, so it can differentiate between an edge leading nowhere and a vector of data, doesn't it?If you put something that looks like an ident (vector of 2, kw first) and ask fulcro to resolve a join, then it will resolve it as a join. That is how it figures out what is an ident and what is a prop....if you query for [:current-locale]
` you get exactly what is at that key in the db (even if it is an ident), but if you query with a join and it looks like an ident, it will follow it.
So, I would expect nil if you gave no initial state, because there should be nothing to query, but it seems your db is not empty?
There is something in the db, you are right. I didn't saw it in my console because it is not reachable from my root query.
{:current-locale [:locale :en]
:locale {:de {:locale :de, :translations ...}