MCPcopy Index your code
hub / github.com/apollographql/fullstack-tutorial / bookTrips

Method bookTrips

final/server/src/datasources/user.js:37–51  ·  view source on GitHub ↗
({ launchIds })

Source from the content-addressed store, hash-verified

35 }
36
37 async bookTrips({ launchIds }) {
38 const userId = this.context.user.id;
39 if (!userId) return;
40
41 let results = [];
42
43 // for each launch id, try to book the trip and add it to the results array
44 // if successful
45 for (const launchId of launchIds) {
46 const res = await this.bookTrip({ launchId });
47 if (res) results.push(res);
48 }
49
50 return results;
51 }
52
53 async bookTrip({ launchId }) {
54 const userId = this.context.user.id;

Callers 3

resolvers.jsFile · 0.45
user.jsFile · 0.45

Calls 1

bookTripMethod · 0.95

Tested by

no test coverage detected