From f5c034019889ffb19c28a0c10919c209411def54 Mon Sep 17 00:00:00 2001 From: Mathew Byrne Date: Mon, 1 Oct 2018 16:47:38 +1000 Subject: [PATCH] Do not strip ptr for args with defaults 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. --- codegen/directive_build.go | 1 - codegen/object_build.go | 1 - 2 files changed, 2 deletions(-) diff --git a/codegen/directive_build.go b/codegen/directive_build.go index 3282884112f..af77dc441f6 100644 --- a/codegen/directive_build.go +++ b/codegen/directive_build.go @@ -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) } diff --git a/codegen/object_build.go b/codegen/object_build.go index ee2b2f1c2b9..328d5adcdbe 100644 --- a/codegen/object_build.go +++ b/codegen/object_build.go @@ -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) }