This commit is contained in:
Simon Podlipsky 2018-09-26 11:18:02 +02:00
parent 4d4282b60f
commit 68bfde953d
No known key found for this signature in database
GPG Key ID: 725C2BD962B42663
5 changed files with 16 additions and 7 deletions

View File

@ -33,3 +33,11 @@ Coding standard of this project is based on [Doctrine CS](https://github.com/doc
```sh
./vendor/bin/phpcs
```
## Running benchmarks
Benchmarks are run via phpbench:
```sh
./vendor/bin/phpbench run
```

View File

@ -57,13 +57,13 @@ class HugeSchemaBench
public function benchSmallQuery()
{
$result = GraphQL::execute($this->schema, $this->smallQuery);
$result = GraphQL::executeQuery($this->schema, $this->smallQuery);
}
public function benchSmallQueryLazy()
{
$schema = $this->createLazySchema();
$result = GraphQL::execute($schema, $this->smallQuery);
$result = GraphQL::executeQuery($schema, $this->smallQuery);
}
private function createLazySchema()

View File

@ -35,7 +35,7 @@ class StarWarsBench
}
';
GraphQL::execute(
GraphQL::executeQuery(
StarWarsSchema::build(),
$q
);
@ -57,7 +57,7 @@ class StarWarsBench
}
}
';
GraphQL::execute(
GraphQL::executeQuery(
StarWarsSchema::build(),
$q
);
@ -81,7 +81,7 @@ class StarWarsBench
}
';
GraphQL::execute(
GraphQL::executeQuery(
StarWarsSchema::build(),
$q
);
@ -89,7 +89,7 @@ class StarWarsBench
public function benchStarWarsIntrospectionQuery()
{
GraphQL::execute(
GraphQL::executeQuery(
StarWarsSchema::build(),
$this->introQuery
);

View File

@ -15,6 +15,7 @@
},
"require-dev": {
"doctrine/coding-standard": "^4.0",
"phpbench/phpbench": "^0.14.0",
"phpstan/phpstan": "^0.10.3",
"phpstan/phpstan-phpunit": "^0.10.0",
"phpunit/phpunit": "^7.2",

View File

@ -18,7 +18,7 @@ try {
$query = $input['query'];
$variableValues = isset($input['variables']) ? $input['variables'] : null;
$result = GraphQL::execute($schema, $query, $rootValue, null, $variableValues);
$result = GraphQL::executeQuery($schema, $query, $rootValue, null, $variableValues);
} catch (\Exception $e) {
$result = [
'error' => [