Bump strawberry-graphql[fastapi] from 0.217.1 to 0.218.1
Bumps strawberry-graphql[fastapi] from 0.217.1 to 0.218.1.
Release notes
Sourced from strawberry-graphql[fastapi]'s releases.
🍓 0.218.1This 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.
Releases contributed by
@patrick91
via #3356
🍓 0.218.0This release adds a new method
get_fields
on theSchema
class. You can useget_fields
to hide certain field based on some conditions, for example:@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 theUser
type.Releases contributed by
@patrick91
via #3274
Changelog
Sourced from strawberry-graphql[fastapi]'s changelog.
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 via [PR #3356](strawberry-graphql/strawberry#3356)
0.218.0 - 2024-01-22
This release adds a new method
get_fields
on theSchema
class. You can useget_fields
to hide certain field based on some conditions, for example:@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 theUser
type.Contributed by Patrick Arminio via [PR #3274](strawberry-graphql/strawberry#3274)
Commits
-
7830bd2
Release🍓 0.218.1 -
998a246
Ignore additional payload data in ws (#3356) -
759ca5d
Fix tests (#3355) -
f45afdf
Bump jinja2 from 3.1.2 to 3.1.3 (#3338) -
08733f8
Fix mypy issues -
5d23399
Release🍓 0.218.0 -
85fb58c
Add a way to filter fields (#3274) -
c26bb05
fix(docs): Pydantic examples are now working properly. (#3341) -
ba65949
Use asyncio.run instead of asgiref for benchmarks (#3325) -
6cba67d
Add more complex benchmark (#3324) - Additional commits viewable in compare view