Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sailor Laravel Package

spawnia/sailor

Sailor generates typed PHP classes from your GraphQL queries, giving Laravel apps autocompletion and static analysis instead of hand-written query strings. Point it at your schema, define operations in .graphql files, and it builds a reusable, type-safe client for your API.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy, for integration layer: Instead of budgeting engineering weeks to hand-roll a client for a third-party GraphQL API (typed request builders, response hydration, error mapping), Sailor generates those classes from the schema. The decision becomes "adopt codegen" vs. "build and maintain a bespoke client" — a cost/risk trade rather than a feature bet.
  • Roadmap scoping for integrations: Expanding an integration's surface area (new fields, new objects, new endpoints) becomes a regeneration-and-review task instead of new client code. This lowers the marginal cost of adding scope to a GraphQL-backed feature and should be reflected in estimates.
  • Feature feasibility for Laravel backends consuming GraphQL: Makes server-to-server GraphQL consumption (headless CMS, commerce platforms, internal services exposing GraphQL) viable inside a PHP codebase without introducing a Node/TS sidecar purely for typed clients.
  • Quality investment and release risk: Typesafe query construction moves upstream schema breakage from runtime (nulls, 400s, partial data in production) to static analysis and CI. That's a concrete argument for shifting effort from QA/manual regression toward PHPStan/CI gates — and for treating schema version pinning as a release-planning dependency.
  • Architecture direction (BFF / internal service mesh): Supports a decision to standardize on GraphQL between services, since the PHP side gains a credible typed client story. Conversely, if this package is the only viable PHP client, that weakens a GraphQL-everywhere mandate.
  • Dependency and provenance decisions: With a small star count and an unresolved repository reference, adopting this is also a supply-chain decision — pin versions, vendor generated output, and decide whether the team owns the generator if upstream stalls.

When to Consider This Package

Adopt when:

  • You have a concrete, reasonably stable GraphQL schema (SDL file or introspection endpoint) and a PHP/Laravel codebase that must consume it.
  • Your team values IDE autocompletion and static analysis on query construction, and already runs PHPStan/Psalm in CI.
  • You're already in the Lighthouse/GraphQL-in-PHP orbit — same author lineage, familiar conventions, lower conceptual overhead.
  • The integration is non-trivial enough to justify codegen — multiple operations, nested types, or an expectation of schema evolution.

Look elsewhere when:

  • The API is REST/OpenAPI; use an OpenAPI generator instead. Forcing GraphQL tooling onto REST is a category error.
  • You need to author a GraphQL server in Laravel — that's Lighthouse, not Sailor.
  • Queries are user-defined or highly dynamic at runtime; generated typed builders assume known operations at build time.
  • It's a single throwaway query — a plain HTTP client and an inline query string is cheaper than a codegen pipeline.
  • You require vendor support, SLAs, or a large hiring pool — 95 stars and a single-maintainer profile won't satisfy procurement or on-call expectations on their own.
  • You need subscriptions/websockets or advanced transport behavior as a first-class concern; validate that explicitly before committing.

Non-negotiable adoption criteria regardless: pin the version, commit generated code to the repo (so it survives upstream abandonment), and confirm the repository/provenance story before it enters your dependency graph.

How to Pitch It (Stakeholders)

To executives: This is a small, MIT-licensed code generator that produces a typed PHP client from a GraphQL schema, replacing hand-written integration code. The business case is speed and defect reduction on API integrations — less bespoke code to write, review, and maintain, and upstream API changes surface in CI rather than in production. There's no license cost and no vendor lock-in: the generated code lives in our repository and can be regenerated or discarded if we walk away.

To engineering: Schema-first codegen gives us typed request builders, autocompletion, and static-analysis coverage on every GraphQL call, and it doesn't dictate our HTTP/runtime layer. Generated classes are checked in and version-pinned, so the build is reproducible and the blast radius of an upstream change is a compile error, not a 3 a.m. page.

Honest caveats to state up front: it's a small-community package with a concentrated maintainer risk and an unresolved repository reference — we should treat it as something we may eventually own, budget a modest spike to validate it against our actual schema, and keep a fallback (hand-written client or a different generator) documented before it becomes load-bearing.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core