From fa5c2d076ae8eea75dba83059bc1b9b41acecbb1 Mon Sep 17 00:00:00 2001 From: Botberry Date: Sun, 12 Jan 2025 10:05:35 +0000 Subject: [PATCH] =?UTF-8?q?Release=20=F0=9F=8D=93=200.258.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ RELEASE.md | 27 --------------------------- pyproject.toml | 2 +- 3 files changed, 33 insertions(+), 28 deletions(-) delete mode 100644 RELEASE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 8edae24b64..dc07371f89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,38 @@ CHANGELOG ========= +0.258.0 - 2025-01-12 +-------------------- + +Add the ability to override the "max results" a relay's connection can return on +a per-field basis. + +The default value for this is defined in the schema's config, and set to `100` +unless modified by the user. Now, that per-field value will take precedence over +it. + +For example: + +```python +@strawerry.type +class Query: + # This will still use the default value in the schema's config + fruits: ListConnection[Fruit] = relay.connection() + + # This will reduce the maximum number of results to 10 + limited_fruits: ListConnection[Fruit] = relay.connection(max_results=10) + + # This will increase the maximum number of results to 10 + higher_limited_fruits: ListConnection[Fruit] = relay.connection(max_results=10_000) +``` + +Note that this only affects `ListConnection` and subclasses. If you are +implementing your own connection resolver, there's an extra keyword named +`max_results: int | None` that will be passed to it. + +Contributed by [Thiago Bellini Ribeiro](https://github.com/bellini666) via [PR #3746](https://github.com/strawberry-graphql/strawberry/pull/3746/) + + 0.257.0 - 2025-01-09 -------------------- diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 35bf8e8414..0000000000 --- a/RELEASE.md +++ /dev/null @@ -1,27 +0,0 @@ -Release type: minor - -Add the ability to override the "max results" a relay's connection can return on -a per-field basis. - -The default value for this is defined in the schema's config, and set to `100` -unless modified by the user. Now, that per-field value will take precedence over -it. - -For example: - -```python -@strawerry.type -class Query: - # This will still use the default value in the schema's config - fruits: ListConnection[Fruit] = relay.connection() - - # This will reduce the maximum number of results to 10 - limited_fruits: ListConnection[Fruit] = relay.connection(max_results=10) - - # This will increase the maximum number of results to 10 - higher_limited_fruits: ListConnection[Fruit] = relay.connection(max_results=10_000) -``` - -Note that this only affects `ListConnection` and subclasses. If you are -implementing your own connection resolver, there's an extra keyword named -`max_results: int | None` that will be passed to it. diff --git a/pyproject.toml b/pyproject.toml index 412b146c31..1a177b222f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "strawberry-graphql" packages = [ { include = "strawberry" } ] -version = "0.257.0" +version = "0.258.0" description = "A library for creating GraphQL APIs" authors = ["Patrick Arminio "] license = "MIT"