Skip to content

Commit 7c3c153

Browse files
author
Salman Ahmad
committed
cleanup
1 parent 91cd9a8 commit 7c3c153

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

internal/exec/resolvable/resolvable.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,12 @@ func (b *execBuilder) makeObjectExec(typeName string, fields schema.FieldList, p
227227

228228
/**
229229
* 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
234234
* 2) Otherwise use resolver type's field
235235
*/
236-
//fmt.Printf("resName=%s, fName=%s\n", rt.Name(), f.Name)
237236
if isResolverSchemaOrType(rt) == true || len(f.Args) > 0 ||
238237
conf.UseResolverMethods == true || rt.Kind() == reflect.Interface {
239238
methodIndex = findMethod(resolverType, f.Name)
@@ -263,9 +262,11 @@ func (b *execBuilder) makeObjectExec(typeName string, fields schema.FieldList, p
263262
Fields[f.Name] = fe
264263
}
265264

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+
*/
269270
typeAssertions := make(map[string]*TypeAssertion)
270271
if isResolverSchemaOrType(rt) == true || conf.UseResolverMethods == true {
271272
for _, impl := range possibleTypes {
@@ -303,6 +304,7 @@ func (b *execBuilder) makeFieldExec(typeName string, f *schema.Field, m reflect.
303304
var hasError bool
304305
var hasContext bool
305306

307+
// Validate resolver method only when there is one
306308
if methodIndex != -1 {
307309
in := make([]reflect.Type, m.Type.NumIn())
308310
for i := range in {

0 commit comments

Comments
 (0)