alanpoulain/api-platform-events-bundle
PreWriteEvent for mutations), simplifying integration with existing workflows.PreDeserializeEvent only for mutations) may necessitate workarounds for query-specific use cases.ApiResource lifecycle callbacks)?PostWriteEvent) to validate event data and performance.ApiResource lifecycle methods or Symfony’s kernel events.api-platform/graphql).composer require alanpoulain/api-platform-events-bundle).config/bundles.php.services.yaml or via annotations/YAML:
services:
App\EventListener\CustomWriteListener:
tags:
- { name: kernel.event_listener, event: api_platform.events.post_write, method: onPostWrite }
ApiPlatformTestClient to verify event dispatching:
$client = static::createClient();
$client->request('POST', '/graphql', [
'json' => ['query' => '{ createUser(input: {}) { ... } }']
]);
$this->assertEventDispatched(PostWriteEvent::class);
AuditPostWriteListener).EventDispatcher debug tools or Xdebug to trace event flows.api_platform.debug) to inspect resolver stages.alanpoulain). Consider forking if critical bugs arise or the bundle stagnates.@try-catch or onKernelException listeners to log errors gracefully.PreWriteEvent vs. PostWriteEvent).EventDispatcherInterface autocompletion to reduce boilerplate.phpunit --filter=EventTest).How can I help you explore Laravel packages today?