-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: update all gql schemas and fix typings issues #98
Conversation
@@ -61,8 +61,10 @@ func (client *Client) ListDatasets(ctx context.Context) (ds []*Dataset, err erro | |||
return nil, err | |||
} | |||
result := make([]*Dataset, 0) | |||
for _, d := range resp.Datasets { |
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.
change for typings change from array of pointers to array of structs
observe/resource_monitor.go
Outdated
for _, stage := range monitor.Query.Stages { | ||
stages = append(stages, &stage) | ||
} | ||
stageIds, err := flattenAndSetQuery(data, stages, monitor.Query.OutputStage) |
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.
Feels like you could adjust flattenAndSetQuery
to accept []Stage
here? That would save you having to dupe the logic at the only two caller sites.
observe/resource_dataset.go
Outdated
if len(gqlstages) == 0 { | ||
return make([]string, 0), nil | ||
} | ||
|
||
queryData, err := flattenQuery(gqlstages, outputStage) | ||
inputstages := make([]*gql.StageQuery, 0) |
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.
You know the length here is going to be len(gqlstages)
observe/resource_dataset.go
Outdated
for _, stage := range gqlstages { | ||
inputstages = append(inputstages, &stage) | ||
} | ||
queryData, err := flattenQuery(inputstages, outputStage) |
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.
Keep changing the signatures. This is the only caller for flattenQuery
, so you should just pass gqlstages
as is.
No description provided.