From 4bc9dfc6f8ca63ec8b5f1500904b332539df9e55 Mon Sep 17 00:00:00 2001 From: Vladimir Razuvaev Date: Wed, 10 Oct 2018 11:29:14 +0200 Subject: [PATCH] Reverted unneeded change in the defaultFieldResolver --- src/Executor/Executor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 4567fa7..7d5c0b9 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -6,6 +6,7 @@ namespace GraphQL\Executor; use ArrayAccess; use ArrayObject; +use Closure; use Exception; use GraphQL\Error\Error; use GraphQL\Error\InvariantViolation; @@ -1523,6 +1524,7 @@ class Executor } } - return is_callable($property) ? $property($source, $args, $context, $info) : $property; + // Using instanceof vs is_callable() because it is 2-10 times faster + return $property instanceof Closure ? $property($source, $args, $context, $info) : $property; } }