Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/move_strawberryconfig_to…
Browse files Browse the repository at this point in the history
…_a_typed_dict' into feature/move_strawberryconfig_to_a_typed_dict
  • Loading branch information
Checho3388 committed Jan 29, 2024
2 parents 0ced727 + 7bc4b4b commit 042fd23
Show file tree
Hide file tree
Showing 46 changed files with 4,046 additions and 914 deletions.
99 changes: 99 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,105 @@
CHANGELOG
=========

0.219.1 - 2024-01-28
--------------------

- Improved error message when supplying in incorrect before or after argument with using relay and pagination.
- Add extra PR requirement in README.md

Contributed by [SD](https://github.com/sdobbelaere) via [PR #3361](https://github.com/strawberry-graphql/strawberry/pull/3361/)


0.219.0 - 2024-01-24
--------------------

This release adds support for [litestar](https://litestar.dev/).

```python
import strawberry
from litestar import Request, Litestar
from strawberry.litestar import make_graphql_controller
from strawberry.types.info import Info


def custom_context_getter(request: Request):
return {"custom": "context"}


@strawberry.type
class Query:
@strawberry.field
def hello(self, info: Info[object, None]) -> str:
return info.context["custom"]


schema = strawberry.Schema(Query)


GraphQLController = make_graphql_controller(
schema,
path="/graphql",
context_getter=custom_context_getter,
)

app = Litestar(
route_handlers=[GraphQLController],
)
```

Contributed by [Matthieu MN](https://github.com/gazorby) via [PR #3213](https://github.com/strawberry-graphql/strawberry/pull/3213/)


0.218.1 - 2024-01-23
--------------------

This release fixes a small issue in the GraphQL Transport websocket
where the connection would fail when receiving extra parameters
in the payload sent from the client.

This would happen when using Apollo Sandbox.

Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #3356](https://github.com/strawberry-graphql/strawberry/pull/3356/)


0.218.0 - 2024-01-22
--------------------

This release adds a new method `get_fields` on the `Schema` class.
You can use `get_fields` to hide certain field based on some conditions,
for example:

```python
@strawberry.type
class User:
name: str
email: str = strawberry.field(metadata={"tags": ["internal"]})


@strawberry.type
class Query:
user: User


def public_field_filter(field: StrawberryField) -> bool:
return "internal" not in field.metadata.get("tags", [])


class PublicSchema(strawberry.Schema):
def get_fields(
self, type_definition: StrawberryObjectDefinition
) -> List[StrawberryField]:
return list(filter(public_field_filter, type_definition.fields))


schema = PublicSchema(query=Query)
```

The schema here would only have the `name` field on the `User` type.

Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #3274](https://github.com/strawberry-graphql/strawberry/pull/3274/)


0.217.1 - 2024-01-04
--------------------

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ poetry install --with integrations
poetry run pytest
```

This will install all the dependencies (including dev ones) and run the tests.
For all further detail, check out the [Contributing Page](CONTRIBUTING.md)


### Pre commit

Expand Down
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
- [Sanic](./integrations/sanic.md)
- [Chalice](./integrations/chalice.md)
- [Starlette](./integrations/starlette.md)
- [Starlite](./integrations/starlite.md)
- [Litestar](./integrations/litestar.md)
- [Creating an integration](./integrations/creating-an-integration.md)
- [Pydantic **experimental**](./integrations/pydantic.md)

Expand Down
Loading

0 comments on commit 042fd23

Please sign in to comment.