From cff073a8b75d6b19fa85eff7de65b90922d38205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Antonio=20Mej=C3=ADa=20Rosales?= Date: Sat, 4 Jan 2020 19:57:34 -0500 Subject: [PATCH] Update resolvers.md I propose removing unnecessary async keyword for regular function. I also found confusing the code block for src/schema.js following the explanation of the resolver for Mission type. The schema shown in the code block differs from what was shown to the user in previous sections and the changes introduced are not relevant as the mission argument that precedes size is never used on this section. --- docs/source/tutorial/resolvers.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/docs/source/tutorial/resolvers.md b/docs/source/tutorial/resolvers.md index 43f4989d0..76121aa01 100644 --- a/docs/source/tutorial/resolvers.md +++ b/docs/source/tutorial/resolvers.md @@ -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: @@ -269,7 +261,7 @@ _src/resolvers.js_ ```js Launch: { - isBooked: async (launch, _, { dataSources }) => + isBooked: (launch, _, { dataSources }) => dataSources.userAPI.isBookedOnLaunch({ launchId: launch.id }), }, User: {