Thanks to visit codestin.com
Credit goes to github.com

Skip to content

railt/railt

Repository files navigation

Railt

Travis CI Code coverage Scrutinizer CI Latest Stable Version Latest Unstable Version License MIT

Introduction

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

Quick start

The documentation is in the process of writing, therefore, in order to understand how it works, a quick start.

schema.graphqls

This is our main GraphQL application schema.

schema {
    query: Example
}

type Example {
    say(message: String = "Hello"): String! 
        @route(action: "ExampleController@say")
}

ExampleController.php

The GraphQL request query { say } handler indicated in the @route directive

class ExampleController
{
    public function say(string $message): string
    {
        return $message;
    }
}

index.php

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();

Example GraphQL query

Request:

# Request
{
    say(message: "Something is awesome!")
}

Response:

{
    "say": "Something is awesome!"
}

Learning Railt

This documentation can contain NOT RELEVANT information and currently in progress.

Contributing

Thank you for considering contributing to the Railt Framework! The contribution guide can be found in the documentation.

Security Vulnerabilities

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.

License

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.

FOSSA Status

Development Status

Not ready for real world usage yet 💣 😱

Packages Release CI Status
railt/railt Latest Stable Version Travis CI
railt/compiler Latest Stable Version Travis CI
railt/discovery Latest Stable Version Travis CI
railt/laravel-provider Latest Stable Version Travis CI
railt/symfony-bundle Latest Stable Version Travis CI
railt/carbon-extension Latest Stable Version Travis CI
Components Release CI Status
railt/container Latest Stable Version Travis CI
railt/http Latest Stable Version Travis CI
railt/io Latest Stable Version Travis CI
railt/sdl Latest Stable Version Travis CI
railt/storage Latest Stable Version Travis CI
railt/lexer Latest Stable Version Travis CI
railt/parser Latest Stable Version Travis CI

Packages

No packages published

Contributors 9

Languages