fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
zilti 2020-09-17T16:11:19.023100Z

Since today I get Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.when I try to use Fulcro Inspect (Inspect itself is just blank, I opened the console for Inspect)

tony.kay 2020-09-17T16:22:08.023500Z

@zilti this? https://github.com/fulcrologic/fulcro-inspect/issues/94

zilti 2020-09-17T16:25:29.024200Z

@tony.kay hmm yes, that solves it, thanks! Weird though... Thanks Google...

Michael W 2020-09-17T17:54:08.024900Z

I placed the resolver for the pathom index explorer into the fulcro-rad-demo app but I am getting an error:

(defresolver index-explorer [env _]
             {::pc/input  #{:com.wsscode.pathom.viz.index-explorer/id}
              ::pc/output [:com.wsscode.pathom.viz.index-explorer/index]}
             {:com.wsscode.pathom.viz.index-explorer/index
              (get env ::pc/indexes)})
Thu Sep 17 10:49:24 MST 2020 [worker-2] ERROR - POST /api java.lang.RuntimeException: java.lang.Exception: Not supported: class com.fulcrologic.rad.blob$blob_resolvers$fn__41338 at com.cognitect.transit.impl.WriterFactory$1.write(WriterFactory.java:65) at cognitect.transit$write.invokeStatic(transit.clj:167) ... Caused by: java.lang.Exception: Not supported: class com.fulcrologic.rad.blob$blob_resolvers$fn__41338 at com.cognitect.transit.impl.AbstractEmitter.marshal(AbstractEmitter.java:194) at com.cognitect.transit.impl.JsonEmitter.emitMap(JsonEmitter.java:171) ... This is the query that fulcro inspect is running that fails:
{[:com.wsscode.pathom.viz.index-explorer/id
  [:fulcro.inspect.core/app-uuid
   #uuid "64989b68-c438-4fe4-9682-63b183441a9b"
   :remote]]
 [:com.wsscode.pathom.viz.index-explorer/id
  :com.wsscode.pathom.viz.index-explorer/index]}

xceno 2020-09-18T14:09:08.000500Z

Hm my explorer code looks a bit different. I have the index explorer working like this: (:require [com.wsscode.pathom.viz.ws-connector.core :as p.connector]

(pc/defresolver index-explorer [env _]
  {::pc/input  #{:com.wsscode.pathom.viz.index-explorer/id}
   ::pc/output [:com.wsscode.pathom.viz.index-explorer/index]}
  {:com.wsscode.pathom.viz.index-explorer/index
   (-> (get env ::pc/indexes)
     (update ::pc/index-resolvers #(into {} (map (fn [[k v]] [k (dissoc v ::pc/resolve)])) %))
     (update ::pc/index-mutations #(into {} (map (fn [[k v]] [k (dissoc v ::pc/mutate)])) %)))})
and then as last step of of cond->> inside build-parser:
(-> config :my.custom.namespace/config :connect-parser)
                      (p.connector/connect-parser
                        {::p.connector/parser-id ::my-parser})
I've added my.custom.namespace/config to the config files and then turn the connector on and off there.

xceno 2020-09-18T14:10:16.000800Z

So in config/dev.edn I have

{:my.custom.namespace/config {:connect-parser true}}

Michael W 2020-09-18T15:30:34.001400Z

@wilkerlucio I got the same error using that DefaultHandler code.

Michael W 2020-09-18T15:31:01.001600Z

@rob703 Using your defresolver worked perfectly.

xceno 2020-09-18T15:31:17.001800Z

Glad to hear that!

wilkerlucio 2020-09-18T15:32:41.002Z

yeah, that's quite annoying, this was one of the motivations to change Resolver to a type in Pathom 3, this way the type can control the transit output, avoiding this attempt to encode fns (which causes this trouble)