strawberry icon indicating copy to clipboard operation
strawberry copied to clipboard

Handling all route errors as strawberry errors

Open ghandic opened this issue 2 years ago • 5 comments

Description

Handle exceptions for FastAPI apps outside of the main schema - eg context_getter

Types of Changes

  • [ ] Core
  • [X] Bugfix
  • [ ] New feature
  • [ ] Enhancement/optimization
  • [ ] Documentation

Issues Fixed or Closed by This PR

Checklist

  • [X] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [X] I have read the CONTRIBUTING document.
  • [X] I have added tests to cover my changes.
  • [X] I have tested the changes and verified that they work and don't break anything (as well as I can manage).

ghandic avatar Feb 22 '23 05:02 ghandic

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


Propagating schema context errors using GraphQL Error schema.


Here's the preview release card for twitter:

Here's the tweet text:

🆕 Release (next) is out! Thanks to Andy Challis for the PR 👏

Get it here 👉 https://github.com/strawberry-graphql/strawberry/releases/tag/(next)

botberry avatar Feb 22 '23 05:02 botberry

Codecov Report

Merging #2589 (f397050) into main (3430d85) will increase coverage by 0.00%. The diff coverage is 100.00%.

:exclamation: Current head f397050 differs from pull request most recent head 59fd23b. Consider uploading reports for the commit 59fd23b to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2589   +/-   ##
=======================================
  Coverage   96.30%   96.30%           
=======================================
  Files         184      184           
  Lines        7571     7582   +11     
  Branches     1394     1394           
=======================================
+ Hits         7291     7302   +11     
  Misses        179      179           
  Partials      101      101           

codecov[bot] avatar Feb 22 '23 11:02 codecov[bot]

@patrick91 bumping this

ghandic avatar Feb 27 '24 23:02 ghandic

@ghandic sorry, I'll check this later in the week, can you tell more on why this is needed?

patrick91 avatar Feb 28 '24 14:02 patrick91

From what I remember it was for when an error came from within the context getter

ghandic avatar Feb 28 '24 20:02 ghandic