Description
API Platform version(s) affected: 3.2.*
Description
GraphQL: In IriConverter->getResourceFromIri()
the exception ApiPlatform\Exception\ItemNotFoundException
is thrown, when not finding a proper data set. ReadStage->getItem()
calls IriConverter->getResourceFromIri()
and catches ItemNotFoundException
s.
In version 3.1.25
catching the exceptions worked.
But since 3.2.0
class ReadStage
uses ApiPlatform\Metadata\Exception\ItemNotFoundException
instead of ApiPlatform\Exception\ItemNotFoundException
, so the exceptions thrown instead catched.
How to reproduce
GraphQL item query that refers to a not existing ID.
In Version 3.1.25
the query returns null
Since version 3.2.0
the query returns null
(as data) and also an "Internal server error".
Possible Solution
Catch both exceptions - or throw/catch the correct exception.