Skip to content

Commit

Permalink
Fix typo in optimizer docs for strawberry.django.type annotation (#334
Browse files Browse the repository at this point in the history
)

The correct annotation should be `@strawberry.django.type` and not `@strawberry.django`. Otherwise you will get a "module is not callable" error.
  • Loading branch information
fireteam99 committed Aug 11, 2023
1 parent 1e55ba3 commit 981fb93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/guide/optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class OrderItem:
price: strawberry.auto
quantity: strawberry.auto
@strawberry.django(only=["price", "quantity"])
@strawberry.django.field(only=["price", "quantity"])
def total(self, root: models.OrderItem) -> decimal.Decimal:
return root.price * root.quantity # or root.total directly
```
Expand Down

0 comments on commit 981fb93

Please sign in to comment.