Fork me on GitHub
#pathom
<
2019-08-29
>
Ian Fernandez19:08:09

hey guys, I'm using this

(def userCredentialsResp [:attributes
                          :blockedUsers
                          :category
                          :citizenId
                          :city
                          :countryCode
                          :diary
                          :email
                          :firebaseUserToken
                          :hourly
                          :industryList
                          {:languageList [:languageId
                                          :proficiency]}
                          {:skillList [:label
                                       :skillId]}
                          :name
                          :password
                          :phone
                          :positionId
                          :profileImage
                          :stateId
                          :summary
                          :title
                          :userId])
 (pcgql/query->graphql `[{(inputCredentials {:userId "6262818231812096​"
                                                        :name "DV"
                                                        :title "C"
                                                        :category "technology"
                                                        :phone "+55660"})
                                     ~userCredentialsResp}] {})

Ian Fernandez19:08:35

and its's returning me a query with this character \\u200b

Ian Fernandez19:08:55

like this:

"mutation {\n  inputCredentials(category: \"technology\", phone: \"+55660\", name: \"DV\", title: \"C\", userId: \"6262818231812096\\u200b\") {\n    attributes\n    blockedUsers\n    category\n    citizenId\n    city\n    countryCode\n    diary\n    email\n    firebaseUserToken\n    hourly\n    industryList\n    languageList {\n      languageId\n      proficiency\n    }\n    skillList {\n      label\n      skillId\n    }\n    name\n    password\n    phone\n    positionId\n    profileImage\n    stateId\n    summary\n    title\n    userId\n  }\n}\n"

wilkerlucio19:08:05

I can't think of any reason why pathom would add that, can you double check if this string doesn't have some hidden character? maybe rewrite just that string and check

Ian Fernandez19:08:45

I've rewrote it many times =< dunno why... for now I've just used #(clojure.string/replace % #"\\u200b" "")

Ian Fernandez19:08:41

it's very strange, I'll see if another case will appear, thanks

wilkerlucio20:08:09

if you can get a consistent repro of the bug, please open an issue so I can look later

Ian Fernandez19:08:33

anyone knows why this character is appearing?

mss19:08:42

is there a way to elide the mutation name from the parse result using the mutate-async mutation fn? is that even advisable? trying to get pathom to hook into fulcro 3's error handling mechanism and trigger an error-action for my mutation. wondering what peoples’ setups look like for that

wilkerlucio19:08:52

this should work as same as in F2, its not desirable to remove it from the results, Fulcro expects the error details to be inside of it

mss19:08:43

I hear that. I guess what I’m struggling with is that the error is boxed up inside of a map like {my-mutation-name {::pc/reader-error ...}}. wondering if there’s any easier way on the api handler side or on the f3 side to determine that it’s an error from the parser besides doing something like (contains? (first (vals parse-result)) ::pathom/reader-error)

mss19:08:29

per the docs here it seems like there should be a ::p/errors key at the top level of the parse result map, but that doesn’t seem to be the case for an error thrown by ex-info. maybe I’m misreading or missing something in my env beyond the error-handler-plugin?

wilkerlucio20:08:31

you need to set ::p/process-error in your environment, this is a fn that receives [env error], the return of it will be the value there in case of errors

mss20:08:15

yep, absolutely. really appreciate the help and all the work you put into this. really a phenomenal library

🙏 4
kenny20:08:31

Does ::pc/params do anything?

wilkerlucio20:08:05

currently its documentation only (it shows up in the Index Explorer). but the name is official and consistent, so you can implement things on top of that (maybe a plugin that does clojure.spec validations using it?), Pathom may add features on top of that, but right now is just official name and doc