@@ -69,8 +69,8 @@ func (b *FieldConfigArgumentsBuilder) WithObject(resourceInputType *graphql.Inpu
69
69
70
70
func (b * FieldConfigArgumentsBuilder ) WithDryRun () * FieldConfigArgumentsBuilder {
71
71
b .arguments [DryRunArg ] = & graphql.ArgumentConfig {
72
- Type : graphql .NewList ( graphql . String ) ,
73
- Description : "If true, the object will not be persisted " ,
72
+ Type : graphql .Boolean ,
73
+ Description : "If true, the operation will be performed in dry-run mode " ,
74
74
}
75
75
return b
76
76
}
@@ -182,24 +182,15 @@ func getDryRunArg(args map[string]interface{}, key string, required bool) ([]str
182
182
return nil , nil
183
183
}
184
184
185
- switch v := val .(type ) {
186
- case []interface {}:
187
- result := make ([]string , len (v ))
188
- for i , item := range v {
189
- str , ok := item .(string )
190
- if ! ok {
191
- err := errors .New ("invalid type in dryRun list: expected string" )
192
- log .Error ().Err (err ).Msg ("dryRun argument must be a list of strings" )
193
- return nil , err
194
- }
195
- result [i ] = str
196
- }
197
- return result , nil
198
- case nil :
199
- return nil , nil
200
- default :
201
- err := errors .New ("invalid type for dryRun argument: expected list of strings" )
202
- log .Error ().Err (err ).Msg ("dryRun argument must be a list of strings" )
185
+ dryRun , ok := val .(bool )
186
+ if ! ok {
187
+ err := errors .New ("invalid type for dryRun argument: expected boolean" )
188
+ log .Error ().Err (err ).Msg ("dryRun argument must be a boolean" )
203
189
return nil , err
204
190
}
191
+
192
+ if dryRun {
193
+ return []string {"All" }, nil
194
+ }
195
+ return nil , nil
205
196
}
0 commit comments