Skip to content

Commit

Permalink
Merge pull request #16 from t3n/resolveTypeFix
Browse files Browse the repository at this point in the history
Allow __resolveType method in type resolver classes
  • Loading branch information
Torsten85 authored May 29, 2019
2 parents 1f9ef1b + abaa968 commit 4b5c447
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Classes/Resolvers.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@

class Resolvers implements ArrayAccess, IteratorAggregate
{
/**
* @var string[]
*/
protected static $internalGraphQLMethods = [
'__schema',
'__resolveType'
];

/**
* @Flow\Inject
*
Expand Down Expand Up @@ -58,7 +66,7 @@ static function (ReflectionMethod $method): string {
$classReflection->getMethods(ReflectionMethod::IS_PUBLIC)
),
static function (string $methodName): bool {
return $methodName === '__schema' || substr($methodName, 0, 2) !== '__';
return in_array($methodName, self::$internalGraphQLMethods) || substr($methodName, 0, 2) !== '__';
}
);

Expand Down

0 comments on commit 4b5c447

Please sign in to comment.