Skip to content

Commit 021d70e

Browse files
authored
Apply suggestions from code review
1 parent 5e498fb commit 021d70e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/pages/learn/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ Along with functions for each field on each type:
2626

2727
```js
2828
// Provide data for the `me` field on the `Query` type
29-
function Query_me(obj, args, context, info) {
29+
function Query_me(query, args, context, info) {
3030
return context.request.auth.user
3131
}
3232

3333
// Provide data for the `name` field on the `User` type
34-
function User_name(obj, args, context, info) {
35-
return context.db.getUserFullName(obj.id)
34+
function User_name(user, args, context, info) {
35+
return context.db.getUserFullName(user.id)
3636
}
3737
```
3838

39-
In the example above, the function that provides data for the `me` field on the `Query` type uses information about the authenticated user who made the request, while the the `name` field on the `User` type is populated by using that user's ID to fetch their full name from an existing database.
39+
In the example above, the function that provides data for the `me` field on the `Query` type uses information about the authenticated user who made the request, while the the `name` field on the `User` type is populated by using that user's ID to fetch their full name from a database.
4040

4141
## Query exactly what you need
4242

@@ -64,7 +64,7 @@ Could produce the following JSON result:
6464
}
6565
```
6666

67-
With even a simple query, we can see some of the key features that make GraphQL so powerful. The client can make queries to the API that mirror the structure of the data that they need and then receive just that data in the expected shape with a single request—and without having to worry about what underlying data sources provided it.
67+
With even a simple query, we can see some of the key features that make GraphQL so powerful. The client can make queries to the API that mirror the structure of the data that they need and then receive just that data in the expected shape with a single request—and without having to worry about which underlying data sources provided it.
6868

6969
## Evolve your API without versioning
7070

0 commit comments

Comments
 (0)