app.useGlobalPipes() registers the pipe outside the DI container — it cannot inject services. The APP_PIPE token registers the pipe inside the DI container — it supports full constructor injection and is the preferred approach for any pipe with dependencies or options loaded from environment config.
app.useGlobalPipes() — simple, works well for stateless pipes with no dependencies.
APP_PIPE token — pipe is managed by the DI container and can inject other providers.
useFactory with APP_PIPE allows ValidationPipe options to be read from ConfigService.
APP_PIPE is defined in @nestjs/core — import it from there, not from @nestjs/common.
Multiple APP_PIPE providers can be registered — they all run globally in registration order.