-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
RFC: Augment error extensions type #3701
Comments
For our What you are looking to alter is in this part of the spec and would need altering
|
Thank you for merging the PR (0no-co/graphql.web#36)! Can this repo also be updated with the new version? |
It's a dependency, you can bump this yourself with resolutions |
The latest version does not include the export change: https://www.npmjs.com/package/@0no-co/graphql.web?activeTab=versions. So, It looks like that the release workflow hit the rate limit yesterday: https://github.com/0no-co/graphql.web/actions/runs/11626919247/job/32379391261 Can you try re-running it again? |
@musjj: We dont't release changes immediately all the time. Please stop commenting for a release that'll come eventually. The action should release a preview version. Also all of that said, while I understand why @JoviDeCroock has merged this (it's a trivial addition) you really shouldn't be augmenting this type, since there's no type guarantees around error extensions, and should instead write checks and casts for the extensions type. |
Summary
GraphQL servers can extend the error type with extensions. An example from this repo:
urql/examples/with-refresh-auth/src/client.js
Lines 32 to 36 in 7f9cad5
Depending on the server implementation, the shape of the extensions may be uniform across all error responses. In that case, it would be helpful if the client can augment the default
Record<string, any>
with the actual expected type.Proposed Solution
Augmenting types can look something like this:
The text was updated successfully, but these errors were encountered: