Skip to content

Commit

Permalink
rename config field name
Browse files Browse the repository at this point in the history
  • Loading branch information
abe-tetsu committed Dec 18, 2024
1 parent 5edb122 commit 5081f23
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions clientgenv2/source_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ type StructSource struct {
}

type SourceGenerator struct {
cfg *config.Config
binder *config.Binder
client config.PackageConfig
GenerateConfig *gqlgencConfig.GenerateConfig
StructSources []*StructSource
cfg *config.Config
binder *config.Binder
client config.PackageConfig
genCfg *gqlgencConfig.GenerateConfig
StructSources []*StructSource
}

func NewSourceGenerator(cfg *config.Config, client config.PackageConfig, generateConfig *gqlgencConfig.GenerateConfig) *SourceGenerator {
return &SourceGenerator{
cfg: cfg,
binder: cfg.NewBinder(),
client: client,
GenerateConfig: generateConfig,
StructSources: []*StructSource{},
cfg: cfg,
binder: cfg.NewBinder(),
client: client,
genCfg: generateConfig,
StructSources: []*StructSource{},
}
}

Expand Down Expand Up @@ -151,7 +151,7 @@ func (r *SourceGenerator) NewResponseField(selection ast.Selection, typeName str
typ := r.binder.CopyModifiersFromAst(selection.Definition.Type, baseType)

jsonTag := fmt.Sprintf(`json:"%s"`, selection.Alias)
if r.GenerateConfig.IsEnableClientJsonOmitemptyTag() && isOptional {
if r.genCfg.IsEnableClientJsonOmitemptyTag() && isOptional {
jsonTag = fmt.Sprintf(`json:"%s,omitempty"`, selection.Alias)
}
tags := []string{
Expand Down

0 comments on commit 5081f23

Please sign in to comment.