From 4fc9c9b8d1f4405583b3a3585568be041703808e Mon Sep 17 00:00:00 2001 From: Botberry Date: Thu, 13 May 2021 16:46:52 +0000 Subject: [PATCH] =?UTF-8?q?Release=20=F0=9F=8D=93=200.61.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ RELEASE.md | 26 -------------------------- pyproject.toml | 2 +- 3 files changed, 29 insertions(+), 27 deletions(-) delete mode 100644 RELEASE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index bfb31c56d4..75bd1132b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,34 @@ CHANGELOG ========= +0.61.3 - 2021-05-13 +------------------- + +Fix `@requires(fields: ["email"])` and `@provides(fields: ["name"])` usage on a Federation field + +You can use `@requires` to specify which fields you need to resolve a field + +```python +import strawberry + +@strawberry.federation.type(keys=["id"], extend=True) +class Product: + id: strawberry.ID = strawberry.federation.field(external=True) + code: str = strawberry.federation.field(external=True) + + @classmethod + def resolve_reference(cls, id: strawberry.ID, code: str): + return cls(id=id, code=code) + + @strawberry.federation.field(requires=["code"]) + def my_code(self) -> str: + return self.code +``` + +`@provides` can be used to specify what fields are going to be resolved +by the service itself without having the Gateway to contact the external service +to resolve them. + 0.61.2 - 2021-05-08 ------------------- diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index c4e1769270..0000000000 --- a/RELEASE.md +++ /dev/null @@ -1,26 +0,0 @@ -Release type: patch - -Fix `@requires(fields: ["email"])` and `@provides(fields: ["name"])` usage on a Federation field - -You can use `@requires` to specify which fields you need to resolve a field - -```python -import strawberry - -@strawberry.federation.type(keys=["id"], extend=True) -class Product: - id: strawberry.ID = strawberry.federation.field(external=True) - code: str = strawberry.federation.field(external=True) - - @classmethod - def resolve_reference(cls, id: strawberry.ID, code: str): - return cls(id=id, code=code) - - @strawberry.federation.field(requires=["code"]) - def my_code(self) -> str: - return self.code -``` - -`@provides` can be used to specify what fields are going to be resolved -by the service itself without having the Gateway to contact the external service -to resolve them. diff --git a/pyproject.toml b/pyproject.toml index 7c8a9912e8..8970cc115a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "strawberry-graphql" packages = [ { include = "strawberry" } ] -version = "0.61.2" +version = "0.61.3" description = "A library for creating GraphQL APIs" authors = ["Patrick Arminio "] license = "MIT"