Skip to content

Commit

Permalink
Updated inline example for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
viniychuk committed Jul 13, 2016
1 parent fe73a1b commit de15db9
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,21 @@ $rootQueryType = new ObjectType([
// name for the root query type doesn't matter, by the convention it's RootQueryType
'name' => 'RootQueryType',
'fields' => [
'latestPost' => new ObjectType([ // the Post type will be extended from the generic ObjectType
'name' => 'Post', // name of our type – "Post"
'fields' => [
'title' => new StringType(), // defining the "title" field, type - String
'summary' => new StringType(), // defining the "summary" field, also a String type
],
'latestPost' => [
'type' => new ObjectType([ // the Post type will be extended from the generic ObjectType
'name' => 'Post', // name of our type – "Post"
'fields' => [
'title' => new StringType(), // defining the "title" field, type - String
'summary' => new StringType(), // defining the "summary" field, also a String type
],
]),
'resolve' => function () { // this is a resolve function
return [ // for now it returns a static array with data
"title" => "New approach in API has been revealed",
"summary" => "This post describes a new approach to create and maintain APIs",
];
}
])
]
]
]);
```
Expand Down

0 comments on commit de15db9

Please sign in to comment.