-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🧹use slice filter to list frameworks #1392
Conversation
upstream/framework.gql.go
Outdated
@@ -20,7 +20,7 @@ type UpstreamFramework struct { | |||
State mondoogql.ComplianceFrameworkState | |||
} | |||
|
|||
func ListFrameworks(ctx context.Context, c *gql.MondooClient, scopeMrn string, state *mondoogql.ComplianceFrameworkState) ([]*UpstreamFramework, error) { | |||
func ListFrameworks(ctx context.Context, c *gql.MondooClient, scopeMrn string, states *[]mondoogql.ComplianceFrameworkState) ([]*UpstreamFramework, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this signature looks a bit weird, why not just pass a slice instead of a ptr to a slice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just what mondoogql expects. afaik if we make slice argument mandatory, then you'd have to send empty slice from the frontend to meet the schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this an implementation detail then? We can still pass the slice to the actual GQL call, but i think the arg in this function should be a states []mondoogql...
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the implementation
No description provided.