Fork me on GitHub
#pathom
<
2022-09-12
>
wilkerlucio03:09:00

@lilactown try this, first add a deps alias:

{:guardrails-stubs
  {:override-deps
   {com.fulcrologic/guardrails {:git/url ""
                                :git/sha "063451653a8ab656b436b0258cdb438e7ffac4c6"}}}}
The do the advanced compilation with it, it should remove expound and clojure spec, this is my test result here:

dvingo14:09:04

you should be able to use ns-alias for the release build to eliminate those https://github.com/fulcrologic/guardrails#dead-code-elimination

{:build-options
    {:ns-aliases
     {com.fulcrologic.guardrails.core com.fulcrologic.guardrails.noop}}
but yea, would be nice not to have to do that

šŸ‘ 1
wilkerlucio19:09:08

@lilactown this actually looks the best option to me

lilactown22:09:32

i'll try this. thanks!

Gonzalo Rafael Acosta16:09:37

Hello Pathom and Wilker Lucio, congrats for this great project. Sorry for disturbing your vacations. I think I encountered an issue if I am not mistaken (it's my first experience with the tool) when trying to run a graphql resolver in the browser. I set up a little project to demonstrate the issue: https://github.com/revert-finance/pathom-graphql-test I am getting an exception when trying to run what I think is a valid query https://github.com/revert-finance/pathom-graphql-test/blob/main/src/revert/pathom_graphql_test.cljs#L53 This is the message: Graph execution failed: Required attributes missing: [:univ3.Token/symbol] at path [:staker.Query/incentives 0] Things to notice: ā€¢ This query also fails https://github.com/revert-finance/pathom-graphql-test/blob/main/src/revert/pathom_graphql_test.cljs#L70 with Graph execution failed: Required attributes missing: [:staker.Incentive/contract] at path [] ā€¢ Same queries work in clojure https://github.com/revert-finance/pathom-graphql-test/blob/main/src/revert/pathom_graphql_test.clj (is it a setup issue of my project in cljs?) Thanks in advance

wilkerlucio16:09:43

thanks for the report Gonzalo! I'll have a look at it, one question, when you say it runs on clj, you mean you have the same setup, both in clj and cljs, and it works in one but not the other? or are you requesting your graph made in CLJ from CLJS?

Gonzalo Rafael Acosta16:09:49

Hi Lucio, thanks for the quick reply. I want to run the resolver directly in the browser that's my goal without any backend dependency. What I did to test my setup and check I was not messing things up is to run the same resolver in clj, with the conclusion that in clj works but not in cljs. You can see the two files in here https://github.com/revert-finance/pathom-graphql-test/tree/main/src/revert

wilkerlucio16:09:56

thanks, thats fascinating, I like to dig on it and understand whats going on šŸ™

wilkerlucio16:09:13

thanks for making the repro, it really helps

wilkerlucio16:09:25

will I be able to hit those apis? are they public/free?

wilkerlucio20:09:22

found, was an oversight around dealing with async responses when starting the query from an ident request, bump pathom3-graphql to 2022.09.12-alpha and you should be fine ;)_

wilkerlucio20:09:06

I also notice you are using an outdated version of Pathom 3

wilkerlucio20:09:18

I recommend that you bump to latest 2022.08.29-alpha

Gonzalo Rafael Acosta20:09:01

will do that thanks so much again for the quick response

šŸ™ 1
wilkerlucio20:09:26

also, since you are in some dynamic resolver land, you may be able to take advantage of some experimental optimizations in the planner, if you see that Pathom is making more requests than you expect, try setting :com.wsscode.pathom3.connect.planner/experimental-branch-optimizations true in your env, to try the experimental optimizations

Gonzalo Rafael Acosta20:09:21

amazing thanks, will definitely play with it

Gonzalo Rafael Acosta20:09:37

just checked and it's working šŸ™Œ

šŸŽ‰ 1
sheluchin11:09:09

I've been wondering if anyone's applying Pathom to The Graph. Seems like an interesting pairing.