A PHP library for building Relay-compliant GraphQL servers using the graphql-php reference implementation.
GraphQL Relay PHP is a library that helps developers build GraphQL servers compatible with the Relay JavaScript client. It provides a set of helper functions to implement Relay-specific patterns like connections for pagination, global node identification, and mutations within the graphql-php ecosystem. It solves the problem of manually implementing the Relay GraphQL server specification in PHP.
PHP developers building GraphQL backends that need to support Relay clients, particularly those using the graphql-php reference implementation.
Developers choose this library because it offers a straightforward, specification-compliant way to add Relay support to graphql-php servers, reducing boilerplate and ensuring compatibility with Relay's expectations for pagination, caching, and mutations.
A library to help construct a graphql-php server supporting react-relay.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Faithfully implements Facebook's graphql-relay-js, ensuring compatibility with Relay clients and reducing implementation errors.
Functions like connectionArgs and connectionFromArray simplify building Relay-style paginated connections, as shown in the StarWarsSchema example.
Utilities such as nodeDefinitions and globalIdField handle object identification across the schema, supporting the Node interface seamlessly.
mutationWithClientMutationId streamlines creating Relay-compliant mutations with client IDs, reducing boilerplate code.
As stated in the README, asynchronous functionality from the original JS library is not ported due to PHP limitations, hindering performance in IO-heavy apps.
This library only works with the webonyx/graphql-php implementation, making it incompatible with other GraphQL PHP libraries or frameworks.
For APIs that don't need Relay's advanced features, the helper functions can add unnecessary complexity compared to vanilla graphql-php.
Being a port, it might lag behind updates in graphql-relay-js, potentially missing new features or fixes from the JavaScript ecosystem.