Skip to content

Commit

Permalink
Merge pull request #187 from michaelboke/master
Browse files Browse the repository at this point in the history
Bugfix When the base graphql operation is in lower case the generated…
  • Loading branch information
Yamashou authored Sep 25, 2023
2 parents 7d58543 + 1873de1 commit 2ba6742
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clientgenv2/source_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package clientgenv2
import (
"fmt"
"go/types"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"strings"

"github.com/99designs/gqlgen/codegen/config"
Expand Down Expand Up @@ -156,7 +158,7 @@ func (r *SourceGenerator) NewResponseFieldsByDefinition(definition *ast.Definiti
}

func NewLayerTypeName(base, thisField string) string {
return fmt.Sprintf("%s_%s", base, thisField)
return fmt.Sprintf("%s_%s", cases.Title(language.Und, cases.NoLower).String(base), thisField)
}

func (r *SourceGenerator) NewResponseField(selection ast.Selection, typeName string) *ResponseField {
Expand Down

0 comments on commit 2ba6742

Please sign in to comment.