A PHP GraphQL library that uses attributes/annotations to define your GraphQL schema and controllers.
GraphQLite is a GraphQL library for PHP that allows developers to define their GraphQL API using PHP attributes or annotations. It simplifies creating GraphQL schemas by annotating PHP classes and methods, reducing boilerplate and configuration. The library supports queries, mutations, subscriptions, and integrates seamlessly with PHP frameworks like Symfony and Laravel.
PHP developers building GraphQL APIs who want a declarative, attribute-based approach to schema definition. It's ideal for teams looking to reduce configuration overhead and maintain type safety.
Developers choose GraphQLite for its simplicity and framework-agnostic design, which eliminates complex configuration files. Its attribute-driven approach makes schema definition intuitive and keeps GraphQL logic close to business code.
Use PHP Attributes to declare your GraphQL API
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses PHP 8 attributes to declare GraphQL schemas directly in PHP classes, as shown in the basic example with #[Mutation] and #[Field], reducing boilerplate and keeping schema logic close to business code.
Works with any PHP project while offering optional, dedicated integrations for Symfony and Laravel, making it versatile for different tech stacks without lock-in.
Includes out-of-the-box support for queries, mutations, subscriptions, file uploads, and extensible types, minimizing the need for additional libraries, as highlighted in the 'batteries included' claim.
Leverages PHP's native type hints to ensure consistency between GraphQL types and PHP code, reducing runtime errors and improving maintainability, as emphasized in the type safety philosophy.
Requires PHP 8 or higher for attribute support, which can be a barrier for legacy projects or teams not ready to upgrade, limiting its adoption in older environments.
Schemas are defined via attributes compiled at application startup, making it difficult to dynamically modify or generate schemas based on runtime conditions or user permissions.
Compared to established alternatives like webonyx/graphql-php, GraphQLite has a smaller community and fewer third-party extensions, which might hinder support for niche use cases or integrations.
Uses reflection to parse attributes, which can introduce performance overhead in high-traffic applications compared to pre-compiled or schema-first approaches that avoid runtime introspection.