Handle omitempty correctly for slices
We were generating broken code; fixes #43. Also fixes a bug where
applying omitempty to the entire query was broken by e597cac74c.
This commit is contained in:
@@ -60,6 +60,7 @@ type argument struct {
|
||||
GoName string
|
||||
GoType string
|
||||
GraphQLName string
|
||||
IsSlice bool
|
||||
Options *GenqlientDirective
|
||||
}
|
||||
|
||||
@@ -127,7 +128,8 @@ func (g *generator) getArgument(
|
||||
GraphQLName: graphQLName,
|
||||
GoName: lowerFirst(graphQLName),
|
||||
GoType: goType,
|
||||
Options: directive,
|
||||
IsSlice: arg.Type.Elem != nil,
|
||||
Options: operationDirective.merge(directive),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user