Download the PHP package epalshin/object-to-graphql without Composer
On this page you can find all versions of the php package epalshin/object-to-graphql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download epalshin/object-to-graphql
More information about epalshin/object-to-graphql
Files in epalshin/object-to-graphql
Package object-to-graphql
Short Description This is my package ObjectToGraphql
License MIT
Homepage https://github.com/palshin/object_to_graphql
Informations about the package object-to-graphql
ObjectToGraphQL
I noticed that in my own code (I use Lighthouse PHP for implementation GraphQL API) quite often I first describe the input type in the schema, then I describe the object for this type (DTO). It creates a sense of repetition and makes type system maintenance more difficult, so I decided to add the ability to programmatically generate types for the schema by its type declaration in code. So in my project I expanded this recommendation for third case: DTO for custom resolvers.
Installation
You can install the package via composer:
Usage
The resulting GraphQL schema will be:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Eugene Palshin
- All Contributors
TODO
- [x] Add cyclic addition of types to schema
- [x] Add processing for union types
- [x] Add processing for type category and suffixes parameters passing through attribute
- [x] Add strict mode for early error detection
- [x] Add custom exceptions
- [ ] Write more tests
- [ ] Add possibility for adding description for generated types
License
The MIT License (MIT). Please see License File for more information.