From f30e2e5411d760da537f88897ae7f15f377e92df Mon Sep 17 00:00:00 2001 From: Eudald Dachs Date: Sat, 6 Jan 2024 11:35:26 +0100 Subject: [PATCH] Update mutations.md (#3322) Currently, this piece of code would fail when executing the following query: ``` mutation { fruit{ add(input: {id: "this is only a example"}) { id } } } ``` With the following error: 'NoneType' object has no attribute 'fruit', as it lacks the expected field type. --- docs/general/mutations.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/general/mutations.md b/docs/general/mutations.md index c0eed23bb2..178434f367 100644 --- a/docs/general/mutations.md +++ b/docs/general/mutations.md @@ -169,7 +169,9 @@ class FruitMutations: @strawberry.type class Mutation: - fruit: FruitMutations + @strawberry.field + def fruit(self) -> FruitMutations: + return FruitMutations() ```