src/Executor/Executor.php
public static function defaultResolveFn($source, $args, $root, $ast)
    {
        $property = NULL;
        $key = $ast->get('name')->get('value');

        if ((is_array($source) || $source instanceof \ArrayAccess) && isset($source[$key])) {
            $property = $source[$key];
        }
        else if (is_object($source) && property_exists($source, $key)) {
            if ($key !== 'ofType') {
                $property = $source->{$key};
            }
        }

        return is_callable($property) ? call_user_func($property, $source) : $property;
    }
public static function defaultResolveFn($source, $args, $root, $ast)
    {
        $property = NULL;
        $key = $ast->get('name')->get('value');

        if ((is_array($source) || $source instanceof \ArrayAccess) && isset($source[$key])) {
            $property = $source[$key];
        }
        else if (is_object($source) && property_exists($source, $key)) {
            if ($key !== 'ofType') {
                $property = $source->{$key};
            }
        }

        return is_callable($property) ? call_user_func($property, $source) : $property;
    }
public static function defaultResolveFn ( $ source , $ args , $ root , $ ast ) { $ property = NULL ; $ key = $ ast -> get ( 'name' ) -> get ( 'value' ) ; if ( ( is_array ( $ source ) || $ source instanceof \ ArrayAccess ) && isset ( $ source [ $ key ] ) ) { $ property = $ source [ $ key ] ; } else if ( is_object ( $ source ) && property_exists ( $ source , $ key ) ) { if ( $ key !== 'ofType' ) { $ property = $ source -> { $ key } ; } } return is_callable ( $ property ) ? call_user_func ( $ property , $ source ) : $ property ; }
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.

@param $source
@param $args
@param $root
@param $ast

@return mixed|null
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 .