From 45ed2ba7de447db2cc2f5e5d0c612a35c1af7307 Mon Sep 17 00:00:00 2001 From: Alexandr Viniychuk Date: Sat, 21 May 2016 07:50:33 -0400 Subject: [PATCH] working on the documentation --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1673bb04..d6218b44 100644 --- a/README.md +++ b/README.md @@ -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 [ @@ -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; } @@ -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', @@ -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", @@ -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",