(cache, { data: { cancelTrip } })
| 34 | { |
| 35 | variables: { launchId: id }, |
| 36 | update(cache, { data: { cancelTrip } }) { |
| 37 | // Update the user's cached list of trips to remove the trip that |
| 38 | // was just canceled. |
| 39 | const launch = cancelTrip.launches[0]; |
| 40 | cache.modify({ |
| 41 | id: cache.identify({ |
| 42 | __typename: 'User', |
| 43 | id: localStorage.getItem('userId'), |
| 44 | }), |
| 45 | fields: { |
| 46 | trips(existingTrips: Reference[], { readField }) { |
| 47 | return existingTrips.filter( |
| 48 | tripRef => readField("id", tripRef) !== launch.id |
| 49 | ); |
| 50 | } |
| 51 | } |
| 52 | }); |
| 53 | } |
| 54 | } |
| 55 | ); |
| 56 |
nothing calls this directly
no outgoing calls
no test coverage detected