diff --git a/lib/graphql.go b/lib/graphql.go index 8d2ce7d..3602e3b 100644 --- a/lib/graphql.go +++ b/lib/graphql.go @@ -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 diff --git a/lib/parse.go b/lib/parse.go index 8d84d8b..27ba408 100644 --- a/lib/parse.go +++ b/lib/parse.go @@ -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() diff --git a/lib/write.go b/lib/write.go index 4fa1c90..1e50f31 100644 --- a/lib/write.go +++ b/lib/write.go @@ -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) }