You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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 fieldclassAuthorNode(strawberry.relay.Node):
books_connection: ListConnectionWithTotalCount[Annotated["BookNode", strawberry.lazy(
"graph_api.gql.nodes.book_node"
)]] =strawberry_django.connection(
field_name="books",
extensions=[IsAuthenticated()],
)
```
The text was updated successfully, but these errors were encountered:
When using @strawberry_django.type and inheriting the type from Node it will automatically have an id: GlobalID with a custom resolver that will return the correct value in it.
Is there a reason to why you are trying to define it yourself?
The reason was to keep the types defined with all fields the same way.
I made an addon on top of strawberry_django which makes the modules from the models. Here's the link Strawberry Jam 🍓 @bellini666 I would appreciate some review/feedback on the generated modules, whether they are providing configurations in accordance with the best practices for strawberry django. Also I want to make the tests generation.
I need to think about how to workaround that properly. In the meantime, you can probably skip the id field when creating a type that inherits from Node.
Regarding the lib, very interesting! Will take a look at it as soon as I can 😊
According to documentation something like this
However this works properly
The text was updated successfully, but these errors were encountered: