Consider a schema like the following.
@strawberry.django.type(models.Product)
class ProductType(relay.Node):
id: auto
name: auto
price: auto
tax_rate: auto
group: 'GroupType'
@strawberry.django.type(models.Group)
class GroupType(relay.Node):
id: auto
name: auto
product_count: int = strawberry.django.field(
annotate=Count('products')
)
Querying the list of groups including the productCount
field works as expected, but when querying the group like the following, there is a database error Cannot resolve keyword 'products' into field. Choices are: name, price, tax_rate, group_id, id
:
query GetItems {
products {
edges {
node {
id
name
price
taxRate
group {
id
name
productCount
}
}
}
}
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too