Releases: strawberry-graphql/strawberry
馃崜 0.227.3
This release adds an optimization to ListConnection
such that only queries with
edges
or pageInfo
in their selected fields triggers resolve_edges
.
This change is particularly useful for the strawberry-django
extension's
ListConnectionWithTotalCount
and the only selected field is totalCount
. An
extraneous SQL query is prevented with this optimization.
Releases contributed by @euriostigue via #3480
馃崜 0.227.2
This release fixes a minor issue where the docstring for the relay util to_base64
described the return type incorrectly.
Releases contributed by @gbannerman via #3467
馃崜 0.227.1
This release fixes an issue where annotations on @strawberry.type
s were overridden
by our code. With release all annotations should be preserved.
This is useful for libraries that use annotations to introspect Strawberry types.
Releases contributed by @patrick91 via #3003
馃崜 0.227.0
This release improves the schema codegen, making it more robust and easier to
use.
It does this by introducing a directed acyclic graph for the schema codegen,
which should reduce the amount of edits needed to make the generated code work,
since it will be able to generate the code in the correct order (based on the
dependencies of each type).
Releases contributed by @patrick91 via #3116
馃崜 0.226.2
This release updates our Mypy plugin to add support for Pydantic >= 2.7.0
Releases contributed by @patrick91 via #3462
馃崜 0.226.1
This releases fixes a bug in the mypy plugin where the from_pydantic
method
was not correctly typed.
Releases contributed by @Corentin-Br via #3368
馃崜 0.226.0
Starting with this release, any error raised from within schema
extensions will abort the operation and is returned to the client.
This corresponds to the way we already handle field extension errors
and resolver errors.
This is particular useful for schema extensions performing checks early
in the request lifecycle, for example:
class MaxQueryLengthExtension(SchemaExtension):
MAX_QUERY_LENGTH = 8192
async def on_operation(self):
if len(self.execution_context.query) > self.MAX_QUERY_LENGTH:
raise StrawberryGraphQLError(message="Query too large")
yield
馃崜 0.225.1
馃崜 0.225.0
This release adds support for using FastAPI APIRouter arguments in GraphQLRouter.
Now you have the opportunity to specify parameters such as tags
, route_class
,
deprecated
, include_in_schema
, etc:
import strawberry
from fastapi import FastAPI
from strawberry.fastapi import GraphQLRouter
@strawberry.type
class Query:
@strawberry.field
def hello(self) -> str:
return "Hello World"
schema = strawberry.Schema(Query)
graphql_app = GraphQLRouter(schema, tags=["graphql"])
app = FastAPI()
app.include_router(graphql_app, prefix="/graphql")
Releases contributed by @nparamonov via #3442