Skip to content

Commit 45ed2ba

Browse files
committed
working on the documentation
1 parent d7caa13 commit 45ed2ba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ Now, let's make our GraphQL Schema a little more complex by adding a `likeCount`
449449
// add it after the last ->addField in your build function
450450
->addField('likeCount', new IntType())
451451
// update the resolve function:
452-
public function resolve($value = null, $args = [], $type = null)
452+
public function resolve($value, $args, $info)
453453
{
454454
$id = !empty($args['id']) ? $args['id'] : null;
455455
return [
@@ -566,7 +566,7 @@ $postType = new ObjectType([
566566
'args' => [
567567
'truncated' => new BooleanType() // add an optional argument
568568
],
569-
'resolve' => function ($value, $args) {
569+
'resolve' => function ($value, $args, $info) {
570570
// using argument defined above to modify a field value
571571
return (!empty($args['truncated'])) ? explode(' ', $value)[0] . '...' : $value;
572572
}
@@ -580,7 +580,7 @@ $postType = new ObjectType([
580580
'id' => new IntType()
581581
],
582582
// resolve function for the query
583-
'resolve' => function ($value, $args, $type) {
583+
'resolve' => function ($value, $args, $info) {
584584
return [
585585
'title' => 'Title for the latest Post',
586586
'summary' => 'Post summary',
@@ -621,7 +621,7 @@ class PostType extends AbstractObjectType
621621
$config->addArgument('id', new IntType());
622622
}
623623

624-
public function resolve($value = null, $args = [])
624+
public function resolve($value, $args, $info)
625625
{
626626
return [
627627
"title" => "Title for the latest Post",
@@ -702,7 +702,7 @@ class PostType extends AbstractObjectType
702702
return [new ContentBlockInterface()];
703703
}
704704

705-
public function resolve($value = null, $args = [], $type = null)
705+
public function resolve($value, $args, $info)
706706
{
707707
return [
708708
"title" => "Post title from the PostType class",

0 commit comments

Comments
 (0)