Fork me on GitHub
#pathom
<
2019-10-03
>
moocar09:10:15

Hey folks, I have a pathom parser that uses a shopify index, and adds additional resolvers. I want to reference the parser inside the resolvers so I can make the request to shopify. Is this possible? I'm pulling the parser out of the env like below, but I'm getting an unhelpful NullPointerException deep in the parser

(pc/defresolver resolver [env _]
  {::pc/output [{::foo/all [::foo/id]}]}
  (go {::foo/all (<! ((:parser env) {} [{(:shopify/..) [...]}]))}))

moocar09:10:09

The only way I can get it to work is by constructing a separate parser for the shopify index and passing that into the top level parser ::p/env

souenzzo13:10:33

((:parser env) {} should be ((:parser env) env [{(:shopify/... )}] part also unquoted. so it should be resulting in a [{nil ...}] query

👍 4
moocar20:10:02

Thanks!! That did the trick, at least for queries by ident. For some reason global queries (quoted) [{(:shopify/customers {}) [...]}] are returning {} every time, even when the exact same query works from fulcro inspect query. It might be something unrelated though.

Abhinav Sharma19:10:18

Hello guys, The PartiQL query language from AWS seems like a good target for pathom adapters - would love to hear your thoughts on this https://partiql.org/