src/custom.js
function defaultResolveFn(source, args, context, info) {
  var fieldName = info.fieldName;
  // ensure source is a value for which property access is acceptable.
  if (typeof source === 'object' || typeof source === 'function') {
    return typeof source[fieldName] === 'function'
      ? source[fieldName]()
      : source[fieldName];
  }
}
function defaultResolveFn(source, args, context, info) {
  var fieldName = info.fieldName;
  // ensure source is a value for which property access is acceptable.
  if (typeof source === 'object' || typeof source === 'function') {
    return typeof source[fieldName] === 'function'
      ? source[fieldName]()
      : source[fieldName];
  }
}
function defaultResolveFn ( source , args , context , info ) { var fieldName = info . fieldName ; // ensure source is a value for which property access is acceptable. if ( typeof source === 'object' || typeof source === 'function' ) { return typeof source [ fieldName ] === 'function' ? source [ fieldName ] ( ) : source [ fieldName ] ; } }
If a resolve function is not given, then a default resolve behavior is used
which takes the property of the source object of the same name as the field
and returns it as the result, or if it's a function, returns the result
of calling that function.
If a resolve function is not given then a default resolve behavior is used which takes the property of the source object of the same name as the field and returns it as the result or if it s a function returns the result of calling that function .