Is there a way to change []*Thing
to []Thing
?
#2613
-
Using Can I ask why you preferred to use this type of signature with pointers? Is there a way to change it like in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you mean for an entity (eager-loaded) edges that are a few reasons for this, but the main 2 are: this is how Ent distinguishes between Found/NotFound (see example) and in some cases, we reuse the same object in a few references. For |
Beta Was this translation helpful? Give feedback.
If you mean for an entity (eager-loaded) edges that are a few reasons for this, but the main 2 are: this is how Ent distinguishes between Found/NotFound (see example) and in some cases, we reuse the same object in a few references.
For
gqlgen
integration, we also return pointers to indicatenull
(not found) object. Here's an example: https://github.com/ent/contrib/blob/master/entgql/internal/todo/ent/gql_edge.go#L164