MCPcopy Create free account
hub / github.com/apollographql/fullstack-tutorial / bookTrips

Method bookTrips

start/server/src/datasources/user.js:34–48  ·  view source on GitHub ↗
({ launchIds })

Source from the content-addressed store, hash-verified

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

Callers 2

user.jsFile · 0.45

Calls 1

bookTripMethod · 0.95

Tested by

no test coverage detected