This "bug" may belong into solid-js since the problem itself relays on a function on that package, however I'll post what I found:
When an error occurs in a graphql query, the returning error throws:
Which itself doesn't say much about what could be happening, This particular throw occurred when I passed a wrong query variables, this should return (and has) the error that the server returns. I debug a bit this error to get more information:
I found that this was the function that was throwing the error, so I tried to get something from err before it returned:
So the error is there is just not being displayed, for what the code shows, anything that is not a string will be thrown as "Unknown Error", so my suggestion would be maybe throwing the original error before it goes to "castError" or, a simpler solution and even (a bit dirtier) could be just concatenating all the messages in the array and then throwing the messages, I think with that I can work to try to solve bugs on my end.
I don't think any of my packages is interfering in this case, I was able to replicate this behavior in Stackblizts with only solid-js and @solid-primitives/graphql
Describe the bug
This "bug" may belong into solid-js since the problem itself relays on a function on that package, however I'll post what I found:
When an error occurs in a graphql query, the returning error throws:
Which itself doesn't say much about what could be happening, This particular throw occurred when I passed a wrong query variables, this should return (and has) the error that the server returns. I debug a bit this error to get more information:
I found that this was the function that was throwing the error, so I tried to get something from
err
before it returned:So the error is there is just not being displayed, for what the code shows, anything that is not a string will be thrown as "Unknown Error", so my suggestion would be maybe throwing the original error before it goes to "castError" or, a simpler solution and even (a bit dirtier) could be just concatenating all the messages in the array and then throwing the messages, I think with that I can work to try to solve bugs on my end.
I don't think any of my packages is interfering in this case, I was able to replicate this behavior in Stackblizts with only solid-js and @solid-primitives/graphql
package.json
Minimal Reproduction Link
https://stackblitz.com/edit/github-3drhwq?file=src%2FApp.tsx