You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/learn/index.mdx
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -26,17 +26,17 @@ Along with functions for each field on each type:
26
26
27
27
```js
28
28
// Providedataforthe `me` fieldonthe `Query` type
29
-
functionQuery_me(obj, args, context, info) {
29
+
functionQuery_me(query, args, context, info) {
30
30
returncontext.request.auth.user
31
31
}
32
32
33
33
// Providedataforthe `name` fieldonthe `User` type
34
-
functionUser_name(obj, args, context, info) {
35
-
returncontext.db.getUserFullName(obj.id)
34
+
functionUser_name(user, args, context, info) {
35
+
returncontext.db.getUserFullName(user.id)
36
36
}
37
37
```
38
38
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.
40
40
41
41
## Query exactly what you need
42
42
@@ -64,7 +64,7 @@ Could produce the following JSON result:
64
64
}
65
65
```
66
66
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.
0 commit comments