for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace GraphQL\Benchmarks;
use GraphQL\GraphQL;
use GraphQL\Tests\StarWarsSchema;
use GraphQL\Type\Introspection;
/**
* @BeforeMethods({"setIntroQuery"})
* @OutputTimeUnit("milliseconds", precision=3)
* @Warmup(2)
* @Revs(10)
* @Iterations(2)
*/
class StarWarsBench
{
private $introQuery;
public function setIntroQuery()
$this->introQuery = Introspection::getIntrospectionQuery();
}
public function benchSchema()
StarWarsSchema::build();
public function benchHeroQuery()
$q = '
query HeroNameQuery {
hero {
name
';
GraphQL::executeQuery(
StarWarsSchema::build(),
$q
);
public function benchNestedQuery()
query NestedQuery {
friends {
appearsIn
public function benchQueryWithFragment()
query UseFragment {
luke: human(id: "1000") {
...HumanFragment
leia: human(id: "1003") {
fragment HumanFragment on Human {
homePlanet
public function benchStarWarsIntrospectionQuery()
$this->introQuery