@wilkerlucio is error handling for pathom3 still up in the air per the older blog post?
yeah, I'm having some ideas, but before I say them, I like to hear how you think a good error strategy would be
on Pathom 2 I copied what GraphQL was doing, and have just a separate branch of data for errors, and later add some helpers to move the error closer to the entity (for UI development that seemed a better strategy)
what you think about these current ones? and do you have another idea about how they could be?
currently depends on what you need. I think smart maps are fine, you can have errors out on them. for EQL there are more nuances. if you are not crossing the process, then each map contains all the data you need in the meta, you can use some helpers to find out about specific attribute errors. the wire is a different issue, during development is a good idea to send all the meta over the wire (this empowers pathom viz to do its things), but in prod its a lot of data to keep sending. my current idea is to have built-in plugins to handle that, they process the errors and include in the output, then we can remove the meta and just keep the errors
On the subject of pathom errors. It would be convenient if the EQL response would also include the full exception in data (or object) form rather than string form. For example,
com.wsscode.pathom.core/errors: {
[[:data-source/id {:portfolioKey "xyz", :appKey "xyz"}] :entity.default]: "class com.google.cloud.bigquery.BigQueryException: 401 Unauthorized
POST <https://www.googleapis.com/bigquery/>"
[[:data-source/id {:portfolioKey "xyz", :appKey "xyz"}] :entities]: "class com.google.cloud.bigquery.BigQueryException: 401 Unauthorized
POST <https://www.googleapis.com/bigquery/>"
}
This is from pathom2 ^^
@markaddleman thats a default that was picked because on that time Pathom was used mostly on the wire, but in highsigth was a bad pick. in pathom 3 the standard will keep errors as-is. you can change that in Pathom 2 adding the following to your env: ::p/process-error (fn [env e] e)
ah, that's great and makes my debugging life MUCH better
MVP of tooling for Pathom 3 is out 🎉 ! There is a new version of Pathom Viz app, you can download it at: https://github.com/wilkerlucio/pathom-viz/releases/tag/v2021.1.22-1. More important, there is an update to the connector library: https://github.com/wilkerlucio/pathom-viz-connector If you just update the connector library, you can use it with Pathom 3, updating the app gives you: - Support to see the root graph rendering (this view is a work in progress) - Logs tab (to log plans) - Improved auto-complete algorithm Here you can find an example usage (there is also in the README for the connector lib): https://github.com/wilkerlucio/pathom-viz-connector/blob/master/examples/com/wsscode/pathom_viz/connector/demos/pathom3.clj
just also make sure you are on pathom 3 latest commit