Fork me on GitHub
#pathom
<
2020-04-23
>
Jakub Holý (HolyJak)11:04:21

Anyone experienced with Pathom Connect and GraphQL integration? Is there a way to teach it to understand errors (since GQL always return 200), similar to Fulcro's configurable :remote-error? ? I know that if the response boody contains :data nil, :errors [..] something went wrong and I want to get and e.g. log the errors. Hm, I see that graphql-resolve actually extracts both data errors from the response, just doesn't show the errors to me... Do I need to add something to the query or add some pathom plugin to be able to see the graphql errors? I have added these to my query :com.wsscode.pathom.connect.graphql2/errors :com.wsscode.pathom/trace but I got nothing back.

Chris O’Donnell12:04:06

@holyjak You can customize the parser that gets called to inject the errors as you like into your result. Here's an example parser: https://wilkerlucio.github.io/pathom/#CustomResultParsing. Looking at graphql-resolve, the errors should be available under ::pcg/errors in env. I have not done this personally, but I believe it should work looking at the code.

❤️ 4
Jakub Holý (HolyJak)15:04:57

Hi! If you learn something about the graphql integration, especially ::pcg/ident-map and queries with fields that take 1 or more params, share it! I really struggle here... (The docs worked for me for a top-level field but I struggle for nested ones.)

Chris O’Donnell19:04:18

I would love to help, but just don't have the time at the moment!

👍 4
Jakub Holý (HolyJak)13:04:31

Thanks! Looking at com.wsscode.pathom.connect.graphql2/error-stamper it seems it should actually propagate these errors to the ::p/errors* , I wander why it does not work for me... Thanks for the tip, this might help in troubleshooting!

Jakub Holý (HolyJak)13:04:09

I found it, error-stamper ignores the error because its path does not match with what it expects. Opened an issue: https://github.com/wilkerlucio/pathom/issues/152