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

Fixed Issue: #2195 500 error when sending empty JSON payload to Graph... #2202

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

000xs
Copy link

@000xs 000xs commented Oct 18, 2024

Fixed Issue: #2195 500 error when sending empty JSON payload to Graph…

Description of the PR

This pull request addresses an issue where the GraphQL server returned a 500 internal server error when an empty or invalid JSON payload was sent to the /query endpoint.

Changes:

  • Error handling: Updated the server to return a 400 bad request instead of 500 for invalid JSON input.
  • Error message: Improved the error message to provide more context about the issue.

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If GraphQL schema is changed, GraphQL client updates/additions have been made
  • If OpenAPI spec is changed, make generate has been run
  • If ent schema is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

@000xs 000xs changed the title Fixed Issue: #2195 500 error when sending empty JSON payload to Graph… Fixed Issue: #2195 500 error when sending empty JSON payload to Graph... Oct 18, 2024
Copy link
Collaborator

@pxp928 pxp928 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @000xs! Looks like the change introduced breaks the e2e tests. Though I am not sure if this is the right location for this fix, I would think this issue needs to be at the graphQL server or client side...

dependabot bot and others added 10 commits October 20, 2024 02:56
Bumps [actions/cache](https:/actions/cache) from 4.1.0 to 4.1.1.
- [Release notes](https:/actions/cache/releases)
- [Changelog](https:/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@2cdf405...3624ceb)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Sithum Sathsara <[email protected]>
Signed-off-by: Sithum Sathsara <[email protected]>
Signed-off-by: Sithum Sathsara <[email protected]>
Signed-off-by: Sithum Sathsara <[email protected]>
Signed-off-by: Sithum Sathsara <[email protected]>
@mihaimaruseac
Copy link
Collaborator

Can you remove the changes to the files that are not relevant to this PR? Looks like you had an incomplete merge conflict resolution?

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

Successfully merging this pull request may close these issues.

3 participants