diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000000..7b517822ad --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,35 @@ +Release type: minor + +Added new `PartialResultsExtension` to allow adding exceptions to `info.context.partial_errors` to get added to the result after execution, allowing users to add errors to the errors array from a field resolver while still resolving that field. + +**Usage example:** + +```python +import strawberry +from strawberry.extensions import PartialResultsExtension + +schema = strawberry.Schema(Query, extensions=[PartialResultsExtension]) + +# ... + + +@strawberry.field +def query(self, info) -> bool: + info.context.partial_errors.append(Exception("Partial failure")) + return True +``` + +Results: + +```json +{ + "data": { + "query": true + }, + "errors": [ + { + "message": "Partial failure" + } + ] +} +```