Skip to content

Commit

Permalink
rename Arg.TypeExt -> Arg.DefaultValue
Browse files Browse the repository at this point in the history
  • Loading branch information
mununki committed Apr 2, 2024
1 parent 1aeac27 commit 8f5e8e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type Type struct {
type Arg struct {
Name string
Type string
TypeExt *string // in case of default values e.g. admin(role: Role = ADMIN): Admin!
DefaultValue *string // in case of default values e.g. admin(role: Role = ADMIN): Admin!
Null bool
IsList bool
IsListNull bool
Expand Down
2 changes: 1 addition & 1 deletion lib/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (p *Parser) parseArgs() []*Arg {
p.lex.consumeToken(tokEqual)
tex, _ := p.lex.consumeIdentInclString(tokNumber)
te := tex.String()
arg.TypeExt = &te
arg.DefaultValue = &te
}
}
arg.Directives = p.parseDirectives()
Expand Down
4 changes: 2 additions & 2 deletions lib/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ func (ms *MergedSchema) stitchArgument(a *Arg, l int, i int) {
if !a.Null {
ms.buf.WriteString("!")
}
if a.TypeExt != nil {
ms.buf.WriteString(" = " + *a.TypeExt)
if a.DefaultValue != nil {
ms.buf.WriteString(" = " + *a.DefaultValue)
}
ms.stitchDirectives(a.Directives)
}
Expand Down

0 comments on commit 8f5e8e5

Please sign in to comment.