@@ -449,7 +449,7 @@ Now, let's make our GraphQL Schema a little more complex by adding a `likeCount`
449
449
// add it after the last ->addField in your build function
450
450
->addField('likeCount', new IntType())
451
451
// update the resolve function:
452
- public function resolve($value = null , $args = [] , $type = null )
452
+ public function resolve($value, $args, $info )
453
453
{
454
454
$id = !empty($args['id']) ? $args['id'] : null;
455
455
return [
@@ -566,7 +566,7 @@ $postType = new ObjectType([
566
566
'args' => [
567
567
'truncated' => new BooleanType() // add an optional argument
568
568
],
569
- 'resolve' => function ($value, $args) {
569
+ 'resolve' => function ($value, $args, $info ) {
570
570
// using argument defined above to modify a field value
571
571
return (!empty($args['truncated'])) ? explode(' ', $value)[0] . '...' : $value;
572
572
}
@@ -580,7 +580,7 @@ $postType = new ObjectType([
580
580
'id' => new IntType()
581
581
],
582
582
// resolve function for the query
583
- 'resolve' => function ($value, $args, $type ) {
583
+ 'resolve' => function ($value, $args, $info ) {
584
584
return [
585
585
'title' => 'Title for the latest Post',
586
586
'summary' => 'Post summary',
@@ -621,7 +621,7 @@ class PostType extends AbstractObjectType
621
621
$config->addArgument('id', new IntType());
622
622
}
623
623
624
- public function resolve($value = null , $args = [] )
624
+ public function resolve($value, $args, $info )
625
625
{
626
626
return [
627
627
"title" => "Title for the latest Post",
@@ -702,7 +702,7 @@ class PostType extends AbstractObjectType
702
702
return [new ContentBlockInterface()];
703
703
}
704
704
705
- public function resolve($value = null , $args = [] , $type = null )
705
+ public function resolve($value, $args, $info )
706
706
{
707
707
return [
708
708
"title" => "Post title from the PostType class",
0 commit comments