This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-23
Channels
- # announcements (2)
- # atom-editor (3)
- # babashka (49)
- # beginners (100)
- # biff (9)
- # calva (78)
- # clj-kondo (18)
- # clojure (143)
- # clojure-europe (13)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-spec (5)
- # clojure-sweden (2)
- # clojure-uk (4)
- # clojurescript (58)
- # conjure (1)
- # cursive (4)
- # datascript (11)
- # datomic (63)
- # docker (7)
- # emacs (18)
- # events (1)
- # fulcro (18)
- # graalvm (5)
- # helix (4)
- # improve-getting-started (13)
- # jobs (4)
- # jobs-discuss (3)
- # lsp (15)
- # malli (90)
- # membrane (14)
- # off-topic (12)
- # other-languages (5)
- # pedestal (7)
- # polylith (53)
- # re-frame (15)
- # reitit (23)
- # releases (4)
- # remote-jobs (9)
- # ring (11)
- # shadow-cljs (90)
- # specter (2)
- # testing (3)
- # tools-build (63)
- # vim (2)
- # xtdb (8)
I have a problem. I am writing an app in vanilla Fulcro (not RAD). I have a remote mutation in a clj
file and I am trying to invoke it from the client db in a cljs
file. I have been using:
(eql/query->ast1 `[(com.yardwerkz.model.account/werker-account-setup ~params)])
to translate the mutation name, but this breaks file uploads. What is the recommended solution? Thanks in advance.RAD doesn't matter for this question 🙂
m/with-params
, etc. There are helpers to help you get this right
you're including a file upload in this particular mutation? Not sure why that would break anything. I think uploads add metadata to the params. could be the EQL functions are losing the metadata?
if so that is a bug and the helpers will probably fail as well...using the latest versions? EQL has had a patch or two here and there
I dug into wrap-file-upload
on the client side. There is call to query->ast
in order to convert the metadata into a file part for upload. But when I use query->ast1
the parameters are not at the level of the vector, but nested one deeper, so it returns nil
.
Ah — I may be wrong about this. I am basically not sure why my flle uploads don’t get sent to the backend.
@U0CKQ19AQ I am wrong about this. sorry.
The problem was with the use of FormData
in react native, which behaves differently than JS.
for context, this is why I asked that question for: https://github.com/fulcrologic/fulcro/issues/508 Can someone provide me with clues? I'm not sure if I'm doing things right.
The question does not provide enough context. Why do you need to query for the SM? An SM can "insert" data 8nto the actor component's place in the client DB, so do that and query for that data.
See eg uism/assoc-aliased, uism/alias-value
@U0522TWDA thanks for your answer. Your blog helped me a bit with that issue. I haven't been able to find any way to get the active-state, though.
Now I'm using [::uism/asm-id '_]
in my query, which kind of works, except I'm pulling any sm, not just the one the component instance is looking for
I guess I could also manually insert the state with a mutation after each state transition, but it seems counter intuitive to me.
Ok so you can't use assoc-aliased because it is not about some data but about the SM's state? Could you change the SM to store its state into the entity using assoc-aliased upon each transition? Hard to advise without understanding more of your problem and design
thank for your answers, I actually figured it out.
fulcro is fantastic btw it's a bit of a learning curve but I'm very happy with it!