joselfonseca/lighthouse-graphql-passport-auth
Adds Laravel Passport authentication to Lighthouse GraphQL APIs, with register, login, refresh, logout, and current-user mutations plus configurable guards and token handling for securing GraphQL endpoints.
Package: joselfonseca/lighthouse-graphql-passport-auth — GraphQL auth mutations (register, login, refresh, logout, forgot/reset password, social login) for Laravel apps running Lighthouse GraphQL on top of Laravel Passport.
Architecture fit: Narrow but well-defined. It sits at the intersection of three moving parts — Laravel, Lighthouse (schema directives + GraphQL execution), and Passport (OAuth2 token issuance). For teams already committed to that trio, it removes a meaningful amount of boilerplate (token issuance, refresh-token rotation, password grant wiring, schema type definitions). It is a poor fit for teams not already on Lighthouse, or for teams using Sanctum/session auth — it does not abstract over auth strategies.
Integration feasibility: Straightforward mechanically — composer require, publish config, run Passport migrations, register the provided schema/types and directives. The real cost is version-matrix alignment: this package's majors track Passport majors, which in turn track Laravel majors. That cascades into the Lighthouse version, PHP version, and laravel/passport constraint simultaneously.
Technical risk — this release: 11.0.0 is a major bump whose entire documented delta is one line: "Passport 13 Support." By semver convention a major bump signals breaking changes, and the changelog does not say what breaks. The most probable breaking surface, none of it documented:
Additional structural risk: single-maintainer package, low bus factor, and "New Contributors" indicates this release's headline feature came from a first-time contributor — good for the project, but it means the core maintainer did not necessarily author the compatibility work. Release cadence is event-driven (it bumps when Passport bumps), so upgrades are externally forced rather than schedulable on your terms.
Key questions to resolve before adopting 11.0.0:
composer.json constraint set for laravel/framework, laravel/passport, nuwave/lighthouse, and PHP in 11.0.0 vs 10.0.4?src/ and graphql/ trees, not just the changelog.Stack fit: Assume Laravel 11/12, PHP 8.2+, Lighthouse 6.x, Passport 13. If we are on Passport 12 or Lighthouse 5.x, 11.0.0 is likely unavailable to us and we should stay pinned at 10.0.4 until we plan the broader framework upgrade. This package should never be the item that drives a Laravel major upgrade; it should follow one.
Migration path (10.0.4 → 11.0.0):
composer.json at both tags and running composer why-not against our lockfile.laravel/passport to 13 first, in isolation, and validate existing token issuance before touching this package.^11.0, then run the full auth test suite: register, login, refresh, logout, forgot/reset password, and any social-login path we expose.php artisan lighthouse:print-schema diff against the pre-upgrade output) — this is the fastest way to catch undocumented directive or type changes.10.0.4 pin.Compatibility: Treat the version as a three-way lock: Passport major ↔ this package major ↔ Lighthouse major. Document that tuple in the repo. Anything outside it is unsupported in practice regardless of what Composer resolves.
Sequencing: Do not adopt 11.0.0 reactively on release day. Gate it behind the Passport 13 upgrade ticket and a staging soak covering token refresh and expiry, which are the flows most likely to break silently (they fail at TTL boundaries, not on the first request).
Maintenance: Low ongoing code footprint, but the upgrade obligation is externally imposed: every Passport major will force a corresponding major here, on Passport's schedule, not ours. Sparse release notes mean each bump costs real investigation time. Budget roughly one engineer-day per major bump for constraint analysis, schema diffing, and auth regression testing.
Support: GitHub issues only, no vendor, no SLA. For an auth-critical dependency that is a genuine consideration — mitigate by keeping the surface small (use the package for token issuance, not for business logic) and by owning an integration test suite that does not depend on the maintainer's tests.
Scaling: Token issuance is database- and crypto-bound via Passport, not by this package. The scaling concerns are Passport's: token table growth and pruning (passport:purge), key rotation, and per-request token lookups on authenticated queries. This package adds a thin GraphQL layer that does not materially change throughput characteristics. Auth mutations are inherently write-heavy and low-QPS relative to query traffic.
Failure modes to instrument:
Ramp-up: Low for a Laravel developer familiar with Lighthouse directives — an afternoon to read the schema definitions and config. Moderate for teams new to Lighthouse, because debugging requires comfort with both GraphQL execution order and Passport's grant flows; failures in either layer can look identical from the client side. Recommend that whoever owns this package also owns the Passport upgrade path, so the two are never out of step.
Recommendation: Adopt 11.0.0 only when Passport 13 is already in place or planned in the same cycle. Before merging, obtain answers to questions 1–3 — specifically the constraint diff and the schema diff — since the release notes alone are insufficient to characterize a major version. If we remain on Passport 12, hold at 10.0.4, pin it explicitly, and open a ticket to track the Passport 13 upgrade.
How can I help you explore Laravel packages today?