This is a pure PHP realization of the GraphQL protocol based on the webonyx/graphql-php implementations of the official GraphQL Specification located on Facebook GitHub.
The difference from the above implementations is that the Railt provides the ability to describe the types and extended control of their behavior, thereby solving problems such as:
- Simplifying type declarations
- Types reusage
- Significant simplification of the construction of the API
- More flexible integration with frameworks (e.g. Laravel or Symfony)
- And others
The documentation is in the process of writing, therefore, in order to understand how it works, a quick start.
This is our main GraphQL application schema.
schema {
query: Example
}
type Example {
say(message: String = "Hello"): String!
@route(action: "ExampleController@say")
}The GraphQL request query { say } handler indicated in the @route directive
class ExampleController
{
public function say(string $message): string
{
return $message;
}
}This is the main file that handles all requests to the application. With the same success this role can be performed by any controller in the MVP (MVC with passive models) application, for example on the basis of a Symfony or Laravel.
use Railt\Io\File;
use Railt\SDL\Compiler;
use Railt\Http\Request;
use Railt\Foundation\Application;
use Railt\Routing\RouterExtension;
// Creating a new application
$app = new Application();
// Link to the main SDL of the our application
$schema = File::fromPathname(__DIR__ . '/schema.graphqls');
// Processing of HTTP request
$response = $app->request($schema, new Request());
// And sending a Response
$response->send();Request:
# Request
{
say(message: "Something is awesome!")
}Response:
{
"say": "Something is awesome!"
}This documentation can contain NOT RELEVANT information and currently in progress.
Thank you for considering contributing to the Railt Framework! The contribution guide can be found in the documentation.
If you discover a security vulnerability within Railt, please send an e-mail to maintainer at [email protected]. All security vulnerabilities will be promptly addressed.
The Railt Framework is open-sourced software licensed under the MIT license.
The Railt\Compiler, which is part of the Railt Framework re-distribute under the BSD-3-Clause license.
Not ready for real world usage yet 💣 😱
| Packages | Release | CI Status |
|---|---|---|
railt/railt |
||
railt/compiler |
||
railt/discovery |
||
railt/laravel-provider |
||
railt/symfony-bundle |
||
railt/carbon-extension |
| Components | Release | CI Status |
|---|---|---|
railt/container |
||
railt/http |
||
railt/io |
||
railt/sdl |
||
railt/storage |
||
railt/lexer |
||
railt/parser |