Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@solid-primitives/graphql error throw format #504

Open
jamtycle opened this issue Aug 28, 2023 · 1 comment
Open

@solid-primitives/graphql error throw format #504

jamtycle opened this issue Aug 28, 2023 · 1 comment

Comments

@jamtycle
Copy link

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:
image

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:
image

I found that this was the function that was throwing the error, so I tried to get something from err before it returned:
image

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

"devDependencies": {
        "@tailwindcss/typography": "^0.5.9",
        "autoprefixer": "^10.4.14",
        "daisyui": "^3.1.6",
        "eslint": "^8.43.0",
        "eslint-plugin-solid": "^0.12.1",
        "postcss": "^8.4.24",
        "tailwindcss": "^3.3.2",
        "vite": "^4.3.9",
        "vite-plugin-solid": "^2.7.0"
    },
    "dependencies": {
        "@solid-primitives/graphql": "^2.0.1",
        "@solid-primitives/storage": "^2.0.0",
        "@thisbeyond/solid-select": "^0.14.0",
        "graphql": "^16.7.1",
        "jose": "^4.14.4",
        "solid-js": "^1.7.6",
        "universal-cookie": "^4.0.4"
    }

Minimal Reproduction Link

https://stackblitz.com/edit/github-3drhwq?file=src%2FApp.tsx

@TheElegantCoding
Copy link

any update on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants