Skip to content

Commit

Permalink
Use StructFieldsAlwaysPointers config for named fragment spead
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaflamm committed Apr 17, 2024
1 parent 1cac0a8 commit f6d260e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion clientgenv2/source_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,14 @@ func (r *SourceGenerator) NewResponseField(selection ast.Selection, typeName str
nil,
)

var typ types.Type = baseType
if r.cfg.StructFieldsAlwaysPointers {
typ = types.NewPointer(baseType)
}

return &ResponseField{
Name: selection.Name,
Type: types.NewPointer(baseType),
Type: typ,
IsFragmentSpread: true,
ResponseFields: fieldsResponseFields,
}
Expand Down

0 comments on commit f6d260e

Please sign in to comment.