Skip to content

Commit 788d1a3

Browse files
committed
Light editorial for #4381
1 parent 98eff7f commit 788d1a3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

website/pages/docs/resolver-anatomy.mdx

+5-4
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ When GraphQL.js executes a resolver, it calls the resolver function
3333
with four arguments:
3434

3535
```js
36-
function resolver(source, args, context, info) { ... }
36+
function resolve(source, args, context, info) { ... }
3737
```
3838

3939
Each argument provides information that can help the resolver return the
4040
correct value:
4141

4242
- `source`: The result from the parent field's resolver. In nested fields,
43-
`source` contains the value returned by the parent object. For root fields,
44-
it is often `undefined`.
43+
`source` contains the value returned by the parent object (after resolving any
44+
lists). For root fields, it is the `rootValue` passed to GraphQL, which is often
45+
left `undefined`.
4546
- `args`: An object containing the arguments passed to the field in the
4647
query. For example, if a field is defined to accept an `id` argument, you can
4748
access it as `args.id`.
@@ -85,7 +86,7 @@ A custom resolver is a function you define to control exactly how a field's
8586
value is fetched or computed. You can add a resolver by specifying a `resolve`
8687
function when defining a field in your schema:
8788

88-
```js
89+
```js {6-8}
8990
const UserType = new GraphQLObjectType({
9091
name: 'User',
9192
fields: {

0 commit comments

Comments
 (0)