Fork me on GitHub
#pathom
<
2020-02-15
>
eoliphant19:02:04

Hi, this is a conditional reader, not a pathom problem but just wondering if anyone knows what might be causing this. I’ve a .cljc file like so

(:require 
  ...
  #?@(:clj  [[com.wsscode.pathom.connect :as pc :refer [defresolver defmutation]]
   ...

; further down in the ns
#?(:clj
   (do
     (defresolver all-messages [{:keys [db] :as env} input]
       {::pc/output [{:all-messages [:message/id :message/text :message/author]}]}
server is fine, but my client shadow-cljs build is breaking, saying that ::pc/output is an invalid kw. can’t for the life of me figure out why the cljs build is even ‘seeing’ that

thheller20:02:31

its a reader thing. the code must remain readable but if CLJS doesn't have that alias it is not

thheller20:02:45

breaks in CLJ too

eoliphant20:02:59

if it goes the other way. gotcha