Skip to content

Commit

Permalink
chore: add release md
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleyoesch committed Aug 25, 2023
1 parent 2edc713 commit df16233
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
```

0 comments on commit df16233

Please sign in to comment.