ivome/graphql-relay-php
PHP library for adding Relay support to GraphQL servers. Provides helpers for cursor-based connections, edges, page info, global object identification, and Relay-style mutations, making it easier to build spec-compliant GraphQL APIs.
Connection/Edge/PageInfo, cursor encoding, global object identification via a node interface, mutation types with clientMutationId, input/payload conventions — is a few hundred lines of fiddly, edge-case-heavy code. Buying a thin BSD-licensed adapter on top of webonyx/graphql-php is cheaper than hand-rolling and re-deriving the spec.Adopt when:
webonyx/graphql-php (directly, or via Laravel Lighthouse) and you need Relay-spec compliance rather than generic GraphQL pagination.Look elsewhere when:
graphql-php, or Lighthouse's built-in @paginate/global-ID directives, covers offset or simple cursor pagination without an extra abstraction.For executives: "This only matters if we commit to Relay on the client. If we do, this is a small BSD-licensed helper that implements the Relay spec, so we don't spend engineering weeks on pagination, global IDs, and mutation plumbing. The caveat: ~270 stars and no release since 2021 — so I'd treat it as a pattern to vendor or fork, not a strategic vendor relationship. Recommendation: fund a short spike to validate it inside our actual schema, and make the real decision 'Relay frontend, yes or no.' The library follows from that, not the other way around."
For engineering: "It's a thin adapter over webonyx/graphql-php that gives us Connection/Edge/PageInfo, a node interface with opaque global IDs, and Relay mutation payload types with clientMutationId. It removes the hand-rolled spec edge cases: cursor stability under inserts, ID encoding, mutation input/output conventions. The trade-offs are honest: stale since 2021, small maintainer surface, unaudited against modern PHP and Laravel. Mitigations are cheap — pin the version, keep it behind our own thin abstraction, and lock behavior with contract tests so replacing it is a contained change. If we're on Lighthouse, check overlap with its native pagination and global-ID directives before adding a second layer."
How can I help you explore Laravel packages today?