Add a GraphQL API to your PHP application so clients can fetch exactly the data they need in one request.
Replace multiple REST endpoints with a single GraphQL endpoint in a PHP backend.
Define typed data schemas in PHP and let the library handle query parsing and validation automatically.
Requires Composer and a PHP backend, full documentation lives on an external site, not in the README.
GraphQL is a way for a frontend (like a website or mobile app) to request exactly the data it needs from a backend server, rather than getting a fixed set of fields the way traditional REST APIs provide. Instead of calling many separate endpoints, clients send a single query describing the shape of data they want, and the server responds with exactly that structure. This library brings GraphQL to PHP backends. graphql-php is a PHP implementation of the official GraphQL specification, built to match the behavior of the original JavaScript reference implementation. If you have a PHP application and want to expose a GraphQL API, this library handles the parsing, validation, and execution of GraphQL queries for you. Your job as a developer is to define what types your data has and how to fetch it, the library takes care of processing the incoming requests against those definitions. The README is short and practical. Installation is done through Composer, the standard PHP dependency manager, with a single command. Full documentation lives on a separate website linked from the README, and the repository includes example projects in an examples folder with their own guides. The project follows semantic versioning, meaning major version changes may break compatibility but minor and patch releases should not affect anything marked as part of the public API. The README also notes that the repository is planned to move to a new home, with a linked announcement where users can follow the migration details and share feedback. The project accepts sponsorship through GitHub Sponsors and OpenCollective for those who rely on it commercially.
← webonyx on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.