This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-24
Channels
- # adventofcode (4)
- # announcements (1)
- # aws (6)
- # babashka (18)
- # babashka-sci-dev (18)
- # beginners (12)
- # calva (43)
- # circleci (3)
- # clj-kondo (96)
- # cljdoc (2)
- # clojure (89)
- # clojure-australia (2)
- # clojure-europe (26)
- # clojure-nl (3)
- # clojure-norway (11)
- # clojure-spec (8)
- # clojure-uk (1)
- # clojurescript (28)
- # cursive (25)
- # datahike (6)
- # datalevin (56)
- # datomic (12)
- # docker (15)
- # emacs (9)
- # events (2)
- # figwheel (3)
- # fulcro (15)
- # gratitude (10)
- # introduce-yourself (8)
- # lsp (16)
- # malli (6)
- # nbb (2)
- # off-topic (23)
- # other-languages (2)
- # pathom (4)
- # portal (25)
- # practicalli (1)
- # re-frame (9)
- # releases (1)
- # shadow-cljs (8)
- # sql (6)
- # timbre (3)
Hello fulcro, I have trivial question about Fulcro RAD: How can i get current logged in user and use it as default value inside form? I tried like follow but it doesn't work apparently.
(defsc AuthorQuery [_ {::auth/keys [authorization]}]
{:query [:account/id :account/name ::auth/authorization]
:ident :account/id})
(form/defsc-form BookForm [this props]
{fo/id book/id
fo/attributes [book/name
book/description
book/genre
book/author
]
fo/default-values {
;; :book/author (new-uuid 101)
:book/author AuthorQuery
:book/genre {}}
fo/subforms {:book/genre {fo/title "Genre"
fo/ui GenreForm
fo/can-delete? (fn [parent _]
(> (count (:book/genre (comp/props parent))) 1))
fo/can-add? (fn [parent _]
(and
(< (count (:book/genre (comp/props parent))) 3)
:prepend))}}
fo/route-prefix "book"
fo/title "Edit Book"})
My Book model's author attribute is:
(defattr author :book/author :ref
{ao/target :account/id
ao/required? true
ao/cardinality :one
ao/identities #{:book/id}
ao/schema :production})
Hello, what should be the shape of the data returned by a custom remote in the case of a df/load!
mutation? Can’t find anything in the docs on that topic.
(in my case it’s a local storage remote)
got it, mb: https://book.fulcrologic.com/#_writing_your_own_remote_implementation
Is there a way to include an edge of the client database in a remote mutation?
As an arg or return? You can augment parameters with m/with-params. On return you can augment in ok-action. Lots more options, but those are the most direct
Yes but m/with-params
would mean I need to read the edge in the client database before transact
ing the mutation. I want to read the data I need in the remote
section directly.
You need to explain exactly what you are trying to do if you want an exact answer. step-by-step. Where is the data, where is it to come from, and where/how do you want it sent?
Ok. I need to get some credentials from the client db in order to send them to the fulcro backend, but I’d like to pull them from the client db within the mutation code.
OR, query for the auth stuff in the UI with a link query and combine it in at the transact call site
Understood, thanks