Skip to content

Commit b4ba276

Browse files
committed
fix: always use property to support magic properties in obejcts
1 parent ff5cf8f commit b4ba276

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Execution/Executor.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,12 @@ private function getDefaultFieldResolver(): Closure
759759
if (is_object($source)) {
760760
$propertyName = $info["fieldName"];
761761
$methodName = "get" . ucwords($info["fieldName"]);
762+
// try to use the getter
762763
if (method_exists($source, $methodName)) {
763764
return $source->{$methodName}();
764765
}
765-
if (property_exists($source, $propertyName)) {
766-
return $source->{$propertyName};
767-
}
768-
return null;
766+
// get the property
767+
return $source->{$propertyName};
769768
}
770769
return null;
771770
};

0 commit comments

Comments
 (0)