apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
813 stars 271 forks source link

Return a specific error when attempting to format an Int and it turns out to be bigger than I32 #6143

Closed andrewmcgivery closed 1 month ago

andrewmcgivery commented 1 month ago

Return a specific error when attempting to format an Int and it turns out to be bigger than I32


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

Exceptions

Note any exceptions here

Notes

[^1]: It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. [^2]: Configuration is an important part of many changes. Where applicable please try to document configuration examples. [^3]: Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

svc-apollo-docs commented 1 month ago

❌ Docs Preview Failed

Error

HttpError: Resource not accessible by personal access token - https://docs.github.com/rest/commits/statuses#create-a-commit-status
BrynCooke commented 1 month ago

This looks great. I think we should have this behaviour.

goto-bus-stop commented 1 month ago

Thanks for the PR! It looks like we are actually not raising field errors for any values that are of the wrong type. Also, apparently the parameters.errors array used here does not actually get returned to clients as a field error... definitely not what I would've expected either 😭

5787 is implementing result coercion errors more broadly, and it looks like it also addresses the i32 size issue that this PR fixes. In addition to making sure errors are actually reported as errors. My preference is to land #5787. I'll add the test you built here to that PR.

abernix commented 1 month ago

👋 Thanks for opening this. I'm closing this in lieu of #5787 for the reasons above.