Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Update resolvers.md #744

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions docs/source/tutorial/resolvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,6 @@ Mission: {
},
```

_src/schema.js_
```js
type Mission {
# ... with rest of schema
missionPatch(mission: String, size: PatchSize): String
}
```

The first argument passed into our resolver is the parent, which refers to the mission object. The second argument is the size we pass to our `missionPatch` field, which we use to determine which property on the mission object we want our field to resolve to.

Now that we know how to add resolvers on types other than `Query` and `Mission`, let's add some more resolvers to the `Launch` and `User` types. Copy this code into your resolver map:
Expand All @@ -269,7 +261,7 @@ _src/resolvers.js_

```js
Launch: {
isBooked: async (launch, _, { dataSources }) =>
isBooked: (launch, _, { dataSources }) =>
dataSources.userAPI.isBookedOnLaunch({ launchId: launch.id }),
},
User: {
Expand Down