Skip to content

Commit 39617b6

Browse files
author
Dustin Breuer
committed
Applies suggested changes
1 parent 54e1cf2 commit 39617b6

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/Generator/TypeBuilder.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use GraphQL\Type\Definition\InputObjectType;
1111
use GraphQL\Type\Definition\InterfaceType;
1212
use GraphQL\Type\Definition\ObjectType;
13+
use GraphQL\Type\Definition\ResolveInfo;
1314
use GraphQL\Type\Definition\Type;
1415
use GraphQL\Type\Definition\UnionType;
1516
use Murtukov\PHPCodeGenerator\ArrowFunction;
@@ -936,21 +937,19 @@ protected function buildResolveType($resolveType)
936937
* fn($className) => (($className = "App\\ClassName") && $value instanceof $className)
937938
*
938939
* @param mixed $isTypeOf
939-
*
940-
* @return mixed|ArrowFunction
941940
*/
942-
private function buildIsTypeOf($isTypeOf)
941+
private function buildIsTypeOf($isTypeOf): ArrowFunction
943942
{
944943
if (EL::isStringWithTrigger($isTypeOf)) {
945944
$expression = $this->expressionConverter->convert($isTypeOf);
946945

947-
return ArrowFunction::new()
948-
->addArguments('className')
949-
->setExpression(Literal::new($expression))
950-
->setStatic();
946+
return ArrowFunction::new(Literal::new($expression), 'bool')
947+
->setStatic()
948+
->addArguments('value', 'context')
949+
->addArgument('info', ResolveInfo::class);
951950
}
952951

953-
return $isTypeOf;
952+
return ArrowFunction::new($isTypeOf);
954953
}
955954

956955
/**

0 commit comments

Comments
 (0)