Skip to content

Commit

Permalink
working on the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
viniychuk committed May 21, 2016
1 parent d7caa13 commit 45ed2ba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ Now, let's make our GraphQL Schema a little more complex by adding a `likeCount`
// add it after the last ->addField in your build function
->addField('likeCount', new IntType())
// update the resolve function:
public function resolve($value = null, $args = [], $type = null)
public function resolve($value, $args, $info)
{
$id = !empty($args['id']) ? $args['id'] : null;
return [
Expand Down Expand Up @@ -566,7 +566,7 @@ $postType = new ObjectType([
'args' => [
'truncated' => new BooleanType() // add an optional argument
],
'resolve' => function ($value, $args) {
'resolve' => function ($value, $args, $info) {
// using argument defined above to modify a field value
return (!empty($args['truncated'])) ? explode(' ', $value)[0] . '...' : $value;
}
Expand All @@ -580,7 +580,7 @@ $postType = new ObjectType([
'id' => new IntType()
],
// resolve function for the query
'resolve' => function ($value, $args, $type) {
'resolve' => function ($value, $args, $info) {
return [
'title' => 'Title for the latest Post',
'summary' => 'Post summary',
Expand Down Expand Up @@ -621,7 +621,7 @@ class PostType extends AbstractObjectType
$config->addArgument('id', new IntType());
}

public function resolve($value = null, $args = [])
public function resolve($value, $args, $info)
{
return [
"title" => "Title for the latest Post",
Expand Down Expand Up @@ -702,7 +702,7 @@ class PostType extends AbstractObjectType
return [new ContentBlockInterface()];
}

public function resolve($value = null, $args = [], $type = null)
public function resolve($value, $args, $info)
{
return [
"title" => "Post title from the PostType class",
Expand Down

0 comments on commit 45ed2ba

Please sign in to comment.