Skip to content

Commit

Permalink
fix(graphql): check inheritance in ResolverProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
josef.wagner committed Apr 15, 2024
1 parent 195ff52 commit 522e1cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GraphQl/State/Provider/ResolverProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private function getResourceClass(?object $item, ?string $resourceClass, string
return $itemClass;
}

if ($resourceClass !== $itemClass) {
if ($resourceClass !== $itemClass && !$item instanceof $resourceClass) {
throw new \UnexpectedValueException(sprintf($errorMessage, (new \ReflectionClass($resourceClass))->getShortName(), (new \ReflectionClass($itemClass))->getShortName()));
}

Expand Down

0 comments on commit 522e1cf

Please sign in to comment.