According to documentation something like this
@strawberry_django.type(Author, filters=AuthorFilter, order=AuthorOrder)
class AuthorNode(strawberry.relay.Node):
id: strawberry.relay.GlobalID = strawberry_django.field()
books_connection: ListConnectionWithTotalCount[Annotated["BookNode", strawberry.lazy(
"graph_api.gql.nodes.book_node"
)]] = strawberry_django.connection(
field_name="books",
extensions=[IsAuthenticated()],
)
```
The response comes with ids with pk values
```json
{
"data": {
"authorsConnection": {
"edges": [
{
"node": {
"id": "1",
}
},
{
"node": {
"id": "2",
}
}
],
"totalCount": 2
}
}
}
However this works properly
@strawberry_django.type(Author, filters=AuthorFilter, order=AuthorOrder, fields=["id"]) # note that I have set the id via fields parameter instead of assigning it as a field
class AuthorNode(strawberry.relay.Node):
books_connection: ListConnectionWithTotalCount[Annotated["BookNode", strawberry.lazy(
"graph_api.gql.nodes.book_node"
)]] = strawberry_django.connection(
field_name="books",
extensions=[IsAuthenticated()],
)
```
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