Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SerafimArts authored Dec 29, 2017
1 parent c985e63 commit 3856387
Showing 1 changed file with 14 additions and 35 deletions.
49 changes: 14 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,6 @@ thereby solving problems such as:

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

### Compiler

```php
<?php
declare(strict_types=1);

use Railt\Compiler\Compiler;
use Railt\Reflection\Filesystem\File;

$document = (new Compiler())->compile(File::fromSources('
"""
This is a simple example of
GraphQL RL/SDL language.
"""
type Example {
id: ID!
some: String
}
'));

\var_dump($document);
```

### Application

> `index.php`
```php
Expand All @@ -70,21 +45,25 @@ use Railt\Reflection\Filesystem\File;

$app = new Application(new Compiler());

$schema = File::fromSources('
schema {
query: Example
}

type Example {
say(message: String = "Hello"): String!
@route(action: "ExampleController@say")
}
');
$schema = File::fromFile(__DIR__ . '/schema.graphqls');

$response = $app->request(new Request(), $schema);
$response->send();
```

> `schema.graphqls`
```graphql
schema {
query: Example
}

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

> `ExampleController.php`

```php
Expand Down

0 comments on commit 3856387

Please sign in to comment.