This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-01
Channels
- # aleph (6)
- # announcements (37)
- # aws (1)
- # beginners (67)
- # calva (9)
- # clerk (5)
- # clj-kondo (3)
- # clojure (19)
- # clojure-europe (40)
- # clojure-nl (1)
- # clojure-norway (36)
- # clojure-uk (5)
- # clojuredesign-podcast (7)
- # clojurescript (28)
- # datomic (9)
- # emacs (8)
- # figwheel-main (4)
- # fulcro (6)
- # hyperfiddle (19)
- # integrant (4)
- # java (9)
- # lsp (131)
- # malli (9)
- # missionary (85)
- # off-topic (13)
- # pathom (3)
- # polylith (11)
- # releases (1)
- # sci (4)
- # shadow-cljs (7)
- # specter (2)
- # vscode (1)
- # xtdb (2)
Hi, I have a fulcro app which needs to call a remote call on component load. We have a component which already working. I tool the same code and implementing new one. But on component loading it is not making a remote call. Not sure what I was missing?
(app/fulcro-app
(i18n-utils/with-i18n
{:shared {:licensed? licensed?}
:client-did-mount
(fn [app]
(df/load! app :>/global-config global-number/GlobalConfig {:post-mutation `global-number/data-loaded!}))
:remotes {:remote (remote/remote remote/global-env)}}))
For remote calls we use pathom3 library and the code reference,
(def global-properties
[::numbering-config/enabled?])
...
(pco/defresolver
global-configuration
[]
{::pco/output global-properties}
(p/let [
{:keys [value]} (get-global-config-property)]
(->
(global-config/from :global-config value))))
(pco/defmutation set-global-configuration [config]
{::pco/op-name 'app.global-config/set
::pco/output global-properties}
(p/let [{:keys [error value]} (set-global-config-property (global-config/to :global-config (:settings config)))]
(if error
(throw (ex-info "Failed to save global configuration" {:config (:settings config)} error))
(->
(global-config/from :global-config value)))))
....
(def global-env (pci/register [global-configuration set-global-configuration]))
Your help will be greatly appreciated. Thanks
Thanks @U0522TWDA for your valuable suggestion. I did debug and fixed it.
Hey, any idea why my call to merge! works regardless of the query I use ? I'm using it inside a mutation to sort a list of things and I merge! with the updated tree that is basically at the root. Everything works, my db is updated and all the links are working in the inspect tools, however I noticed that it doesn't care what query I use.
The query is only used for normalization. If you use an incorrect query, then the data will still merge with the database, but it will not be normalized. This is a supported mode of operation, as it is sometimes useful in cases where the data does not get updated but needs to be fast