Skip to content

Commit 3959080

Browse files
committed
Release 🍓 0.278.0
1 parent 258979d commit 3959080

File tree

3 files changed

+74
-69
lines changed

3 files changed

+74
-69
lines changed

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,79 @@
11
CHANGELOG
22
=========
33

4+
0.278.0 - 2025-07-19
5+
--------------------
6+
7+
## Add GraphQL Query batching support
8+
9+
GraphQL query batching is now supported across all frameworks (sync and async)
10+
To enable query batching, add a valid `batching_config` to the schema configuration.
11+
12+
This makes your GraphQL API compatible with batching features supported by various
13+
client side libraries, such as [Apollo GraphQL](https://www.apollographql.com/docs/react/api/link/apollo-link-batch-http) and [Relay](https://github.com/relay-tools/react-relay-network-modern?tab=readme-ov-file#batching-several-requests-into-one).
14+
15+
Example (FastAPI):
16+
17+
```py
18+
import strawberry
19+
20+
from fastapi import FastAPI
21+
from strawberry.fastapi import GraphQLRouter
22+
from strawberry.schema.config import StrawberryConfig
23+
24+
25+
@strawberry.type
26+
class Query:
27+
@strawberry.field
28+
def hello(self) -> str:
29+
return "Hello World"
30+
31+
32+
schema = strawberry.Schema(
33+
Query, config=StrawberryConfig(batching_config={"max_operations": 10})
34+
)
35+
36+
graphql_app = GraphQLRouter(schema)
37+
38+
app = FastAPI()
39+
app.include_router(graphql_app, prefix="/graphql")
40+
```
41+
42+
Example (Flask):
43+
```py
44+
import strawberry
45+
46+
from flask import Flask
47+
from strawberry.flask.views import GraphQLView
48+
49+
app = Flask(__name__)
50+
51+
52+
@strawberry.type
53+
class Query:
54+
@strawberry.field
55+
def hello(self) -> str:
56+
return "Hello World"
57+
58+
59+
schema = strawberry.Schema(
60+
Query, config=StrawberryConfig(batching_config={"max_operations": 10})
61+
)
62+
63+
app.add_url_rule(
64+
"/graphql/batch",
65+
view_func=GraphQLView.as_view("graphql_view", schema=schema),
66+
)
67+
68+
if __name__ == "__main__":
69+
app.run()
70+
```
71+
72+
Note: Query Batching is not supported for multipart subscriptions
73+
74+
Contributed by [Aryan Iyappan](https://github.com/aryaniyaps) via [PR #3755](https://github.com/strawberry-graphql/strawberry/pull/3755/)
75+
76+
477
0.277.1 - 2025-07-19
578
--------------------
679

RELEASE.md

Lines changed: 0 additions & 68 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "strawberry-graphql"
3-
version = "0.277.1"
3+
version = "0.278.0"
44
description = "A library for creating GraphQL APIs"
55
authors = [{ name = "Patrick Arminio", email = "[email protected]" }]
66
license = { text = "MIT" }

0 commit comments

Comments
 (0)