Skip to content

Commit

Permalink
skip fields with incompatible types
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercactapus committed Jun 15, 2018
1 parent 27e61b8 commit d0aba4a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion codegen/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
}
Expand Down

0 comments on commit d0aba4a

Please sign in to comment.