https://github.com/mathsgod/r-graphql
https://github.com/mathsgod/r-graphql
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mathsgod/r-graphql
- Owner: mathsgod
- Created: 2019-01-09T08:16:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-20T09:50:36.000Z (about 6 years ago)
- Last Synced: 2025-03-13T09:03:25.060Z (over 1 year ago)
- Language: PHP
- Size: 262 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# r-graphql
```php
try {
$schema = Schema::Build(file_get_contents(__DIR__ . "/schema.gql"), $this->app);
} catch (Exception $e) {
return ["error" => [
"message" => $e->getMessage()
]];
}
$this->request->getBody()->getContents();
$input = json_decode($input, true);
$query = $input['query'];
$variableValues = $input['variables'];
$schema->debug=true;//debug mode
$result = $schema->executeQuery($query, $variableValues);
$this->write(json_encode($result));
```
### Scalar function added
### JWT
```php
try {
$schema = Schema::Build(file_get_contents(__DIR__ . "/schema.gql"), $this->app);
$schema->validation($jwt, $key, function ($payload) {
print_r($payload);
});
} catch (Exception $e) {
return ["error" => [
"message" => $e->getMessage()
]];
}
```