Bug in cancelTrip method from User datasource
@stemmlerjs is already working on this.
Since Feb 18, 2020.
Assessment
This issue has not been assessed yet.
Description
Due to this line cancelTrip throws an error.
{
"errors": [
{
"message": "Cannot read property 'flight_number' of undefined",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"cancelTrip"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"stacktrace": [
"TypeError: Cannot read property 'flight_number' of undefined",
// ....
Following change will fix the error.
async cancelTrip({ launchId }) {
const userId = this.context.user.id;
const numberOfDeletedTrips = await this.store.trips.destroy({ where: { userId, launchId } });
return numberOfDeletedTrips !== 0;
}
As per the doc of destroy it returns number of deleted resources wrapped in Promise. So it should be resolved to get the count to decide if resources are deleted or not.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 808
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apollographql/fullstack-tutorial
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
investigate
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
documentation
apollographql/fullstack-tutorial#285 · 3 comments · 1 assignee ·
-
investigate
Difficulty 3/5 1-2 days Newbie friendliness 35/100
apollographql/fullstack-tutorial#255 · 2 reactions ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 25/100
apollographql/fullstack-tutorial#254 · 2 comments ·
All issues in apollographql/fullstack-tutorial
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100