@@ -227,13 +227,12 @@ func (b *execBuilder) makeObjectExec(typeName string, fields schema.FieldList, p
227
227
228
228
/**
229
229
* 1) Use resolver type's method when
230
- * 1.1) __Type and __Schema requests
231
- * 1.2) or field has arguments
232
- * 1.3) or it is configured to use method
233
- * 1.4) or it is an interface
230
+ * 1.1) __Type and __Schema requests
231
+ * 1.2) Or field has arguments
232
+ * 1.3) Or it is configured to use method
233
+ * 1.4) Or it is an interface
234
234
* 2) Otherwise use resolver type's field
235
235
*/
236
- //fmt.Printf("resName=%s, fName=%s\n", rt.Name(), f.Name)
237
236
if isResolverSchemaOrType (rt ) == true || len (f .Args ) > 0 ||
238
237
conf .UseResolverMethods == true || rt .Kind () == reflect .Interface {
239
238
methodIndex = findMethod (resolverType , f .Name )
@@ -263,9 +262,11 @@ func (b *execBuilder) makeObjectExec(typeName string, fields schema.FieldList, p
263
262
Fields [f .Name ] = fe
264
263
}
265
264
266
- // check type assertions when
267
- // 1) __Type and __Schema requests
268
- // 2) or it is configured to use method
265
+ /**
266
+ * Check type assertions when
267
+ * 1) __Type and __Schema requests
268
+ * 2) Or it is configured to use method
269
+ */
269
270
typeAssertions := make (map [string ]* TypeAssertion )
270
271
if isResolverSchemaOrType (rt ) == true || conf .UseResolverMethods == true {
271
272
for _ , impl := range possibleTypes {
@@ -303,6 +304,7 @@ func (b *execBuilder) makeFieldExec(typeName string, f *schema.Field, m reflect.
303
304
var hasError bool
304
305
var hasContext bool
305
306
307
+ // Validate resolver method only when there is one
306
308
if methodIndex != - 1 {
307
309
in := make ([]reflect.Type , m .Type .NumIn ())
308
310
for i := range in {
0 commit comments