From d0aba4ac7fc1e55371b4f7494160e8f92df0bdb0 Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Fri, 15 Jun 2018 13:37:47 -0500 Subject: [PATCH] skip fields with incompatible types --- codegen/util.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codegen/util.go b/codegen/util.go index f727a3e90b..b647069171 100644 --- a/codegen/util.go +++ b/codegen/util.go @@ -174,6 +174,7 @@ func bindObject(t types.Type, object *Object, imports Imports) error { } if structField := findField(underlying, field.GQLName); structField != nil { + prevModifiers := field.Type.Modifiers field.Type.Modifiers = modifiersFromGoType(structField.Type()) field.GoVarName = structField.Name() @@ -190,7 +191,9 @@ func bindObject(t types.Type, object *Object, imports Imports) error { } default: - return errors.Errorf("type mismatch on %s.%s, expected %s got %s\n", object.GQLType, field.GQLName, field.Type.FullSignature(), structField.Type()) + // type mismatch, require custom resolver for field + field.GoVarName = "" + field.Type.Modifiers = prevModifiers } continue }