Repository navigation
Conversation
|
golanglemonade
left a comment
There was a problem hiding this comment.
initial comments, want to address these because they are schema related before I do a final review
| entx.FieldSearchable(), | ||
| entgql.OrderField("name"), | ||
| ), | ||
| field.Text("query"). |
There was a problem hiding this comment.
we should probably have a validator that this is a valid graphql query because this could be created directly through the API.
There was a problem hiding this comment.
I see you did this in a hook. Any reason you did that over a validator?
| field.Enum("status"). | ||
| GoType(enums.ReportStatus("")). | ||
| Default(enums.ReportStatusDraft.String()). | ||
| Annotations( | ||
| entgql.OrderField("STATUS"), | ||
| ), |
|
|
||
| func (Report) Interceptors() []ent.Interceptor { | ||
| return []ent.Interceptor{ | ||
| interceptors.FilterQueryResults[generated.Report](nil), |
There was a problem hiding this comment.
Why is this needed here? Comment on the function:
// This is automatically added to all schemas using the ObjectOwnedMixin, so should not be added
// directly if that mixin is used
| // if this is being created via api or support user, there will be no "user", so | ||
| // automatically make it visibile org wide | ||
| if m.Op().Is(ent.OpCreate) && auth.IsUserlessContext(ctx) { | ||
| requestedVisibility = enums.ReportVisibilityOrganization | ||
| m.SetVisibility(requestedVisibility) | ||
| } |
There was a problem hiding this comment.
This feels risky. I think we should probably reject instead with a error message that says you have to set that explicitly?
| @@ -0,0 +1,18 @@ | |||
| module base | |||
|
|
|||
| type report | |||
There was a problem hiding this comment.
can you add some fga tests too?


Uh oh!
There was an error while loading. Please reload this page.