@wilkerlucio is it possible to inject something into the parser env from pathom-viz? My eql endpoint adds some authentication data into env that my resolvers need, and I'd like to simulate that.
not sure if I understand, the pathom-viz should be using your parser at all the times, all the calls always goes though your parser, so you shouldn't need to simulate things, are you using the standalone app with the connector?
Yeah, I was thinking about the case of sending queries from the standalone app.
when you do that, it is still processing on your real parser
pathom-viz itself doens't have a parser (to be honest, it does, but its purely for UI purposes, nothing of that is related to calling your parser)
is this something you are experiencing or you were having thoughs about it?
So would you recommend doing something like conditionally adding fake authentication data into the env in a dev-only env wrap plug in?
I am experiencing it.
compared to calling the parser directly, the diff is that you can't add extra env, so all the parser configuration needs to be there already
yeah, you can do that, and consider that the parser can be wrapped, so you can do something like this:
(def tracked-parser
(p.connector/connect-parser
{::p.connector/parser-id ::my-parser}
(fn [env tx]
(parser (assoc env :extra-connector-stuff "bla") tx))))
Ah that's a bit simpler. Thanks!
I'm currently working on replacing a somewhat crufty lacinia-based graphql server with a pathom-backed eql endpoint, and pathom has really been sparking joy. Thanks so much for all the work you've put in!