From c069d20ca751933483b056dd808f0476ed4e97c3 Mon Sep 17 00:00:00 2001 From: spawnia Date: Sun, 30 Jun 2019 23:09:32 +0200 Subject: [PATCH] And a few more in tests --- docs/type-system/schema.md | 2 +- examples/01-blog/Blog/Type/QueryType.php | 4 ++-- tests/Executor/DeferredFieldsTest.php | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/type-system/schema.md b/docs/type-system/schema.md index 08ee12f..e3ae6e0 100644 --- a/docs/type-system/schema.md +++ b/docs/type-system/schema.md @@ -62,7 +62,7 @@ $mutationType = new ObjectType([ 'episode' => $episodeEnum, 'review' => $reviewInputObject ], - 'resolve' => function($val, $args) { + 'resolve' => function($rootValue, $args) { // TODOC } ] diff --git a/examples/01-blog/Blog/Type/QueryType.php b/examples/01-blog/Blog/Type/QueryType.php index ff85577..b7d8075 100644 --- a/examples/01-blog/Blog/Type/QueryType.php +++ b/examples/01-blog/Blog/Type/QueryType.php @@ -57,8 +57,8 @@ class QueryType extends ObjectType ], 'hello' => Type::string() ], - 'resolveField' => function($val, $args, $context, ResolveInfo $info) { - return $this->{$info->fieldName}($val, $args, $context, $info); + 'resolveField' => function($rootValue, $args, $context, ResolveInfo $info) { + return $this->{$info->fieldName}($rootValue, $args, $context, $info); } ]; parent::__construct($config); diff --git a/tests/Executor/DeferredFieldsTest.php b/tests/Executor/DeferredFieldsTest.php index a4021d2..6879e8d 100644 --- a/tests/Executor/DeferredFieldsTest.php +++ b/tests/Executor/DeferredFieldsTest.php @@ -185,7 +185,7 @@ class DeferredFieldsTest extends TestCase 'fields' => [ 'topStories' => [ 'type' => Type::listOf($this->storyType), - 'resolve' => function ($val, $args, $context, ResolveInfo $info) { + 'resolve' => function ($rootValue, $args, $context, ResolveInfo $info) { $this->paths[] = $info->path; return Utils::filter( @@ -198,7 +198,7 @@ class DeferredFieldsTest extends TestCase ], 'featuredCategory' => [ 'type' => $this->categoryType, - 'resolve' => function ($val, $args, $context, ResolveInfo $info) { + 'resolve' => function ($rootValue, $args, $context, ResolveInfo $info) { $this->paths[] = $info->path; return $this->categoryDataSource[0]; @@ -206,7 +206,7 @@ class DeferredFieldsTest extends TestCase ], 'categories' => [ 'type' => Type::listOf($this->categoryType), - 'resolve' => function ($val, $args, $context, ResolveInfo $info) { + 'resolve' => function ($rootValue, $args, $context, ResolveInfo $info) { $this->paths[] = $info->path; return $this->categoryDataSource; @@ -401,7 +401,7 @@ class DeferredFieldsTest extends TestCase return [ 'sync' => [ 'type' => Type::string(), - 'resolve' => function ($v, $a, $c, ResolveInfo $info) { + 'resolve' => function ($rootValue, $a, $c, ResolveInfo $info) { $this->paths[] = $info->path; return 'sync'; @@ -409,7 +409,7 @@ class DeferredFieldsTest extends TestCase ], 'deferred' => [ 'type' => Type::string(), - 'resolve' => function ($v, $a, $c, ResolveInfo $info) { + 'resolve' => function ($rootValue, $a, $c, ResolveInfo $info) { $this->paths[] = $info->path; return new Deferred(function () use ($info) { @@ -421,7 +421,7 @@ class DeferredFieldsTest extends TestCase ], 'nest' => [ 'type' => $complexType, - 'resolve' => function ($v, $a, $c, ResolveInfo $info) { + 'resolve' => function ($rootValue, $a, $c, ResolveInfo $info) { $this->paths[] = $info->path; return []; @@ -429,7 +429,7 @@ class DeferredFieldsTest extends TestCase ], 'deferredNest' => [ 'type' => $complexType, - 'resolve' => function ($v, $a, $c, ResolveInfo $info) { + 'resolve' => function ($rootValue, $a, $c, ResolveInfo $info) { $this->paths[] = $info->path; return new Deferred(function () use ($info) {