php (6)

Iwan Luijks

Pushing GraphQL errors from API Platform to Sentry

By default errors resulting from GraphQL calls done to API Platform don't end up in Sentry. Use the following piece of code and configuration to make sure they will be send to Sentry. namespace MyNamespace; use ApiPlatform\GraphQl\Error\ErrorHandlerInterface; use GraphQL\Error\Error; use Sentry\State\HubInterface; class ErrorHandler implements ErrorHandlerInterface…

Continue reading...
Iwan Luijks

Efficient Doctrine entity iteration

There are a ton of ways described online to iterate entities efficiently in Doctrine 2.* (up to at least 2.17), but the most efficient one is definitely to lookup entities using your own for loop. <?php ... $maxLimit = 100_000; $limit = 200; $offset =…

Continue reading...