Skip to content

Commit

Permalink
Do not strip ptr for args with defaults
Browse files Browse the repository at this point in the history
This fails if a client still sends a null value.  If an arg is nullable
but has a default, then null is still a valid value to send through.
  • Loading branch information
Mathew Byrne committed Oct 2, 2018
1 parent 0c39927 commit f5c0340
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion codegen/directive_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func (cfg *Config) buildDirectives(types NamedTypes) ([]*Directive, error) {
if err != nil {
return nil, errors.Errorf("default value for directive argument %s(%s) is not valid: %s", dir.Name, arg.Name, err.Error())
}
newArg.StripPtr()
}
args = append(args, newArg)
}
Expand Down
1 change: 0 additions & 1 deletion codegen/object_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ func (cfg *Config) buildObject(types NamedTypes, typ *ast.Definition, imports *I
if err != nil {
return nil, errors.Errorf("default value for %s.%s is not valid: %s", typ.Name, field.Name, err.Error())
}
newArg.StripPtr()
}
args = append(args, newArg)
}
Expand Down

0 comments on commit f5c0340

Please sign in to comment.