mathsgod/r-graphql

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (1.5.0) of this package.

GraphQL for php

Installs: 9

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/mathsgod/r-graphql

1.5.0 2020-05-20 09:20 UTC

This package is auto-updated.

Last update: 2025-10-07 15:04:55 UTC


README

PHP Composer

r-graphql

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

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