From 69f7ce91453526c8573ad61f58391cffbbdc4e4a Mon Sep 17 00:00:00 2001 From: Alexandr Viniychuk Date: Sun, 8 May 2016 12:27:33 -0400 Subject: [PATCH] documentation refactoring --- examples/02_blog/test.php | 54 --------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 examples/02_blog/test.php diff --git a/examples/02_blog/test.php b/examples/02_blog/test.php deleted file mode 100644 index 095e3537..00000000 --- a/examples/02_blog/test.php +++ /dev/null @@ -1,54 +0,0 @@ - 'RootQueryType', - 'fields' => [ - // you can specify fields for your query as an array - 'latestPost' => new PostType() - ] -]); - -$rootMutationType = new ObjectType([ - 'name' => 'RootMutationType', - 'fields' => [ - 'likePost' => [ - 'type' => new PostType(), - 'args' => [ - 'id' => new NonNullType(new IntType()) - ], - 'resolve' => function ($value, $args, $type) { - // adding like count code goes here - return [ - 'title' => 'Title for the post #' . $args['id'], - 'summary' => 'We can now get a richer response from the mutation', - 'likeCount' => 2 - ]; - }, - ] - ] -]); - -$processor = new Processor(); - -$processor->setSchema(new Schema([ - 'query' => $rootQueryType, - 'mutation' => $rootMutationType, -])); - -$payload = 'mutation { likePost(id:5) }'; -$processor->processRequest($payload); -echo json_encode($processor->getResponseData()) . "\n";