-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from smartive/fix/delete
fix: Delete
- Loading branch information
Showing
10 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`delete works with self-referential entities 1`] = ` | ||
{ | ||
"deleteAnotherObject": "226a20e8-5c18-4423-99ca-eb0df6ff4fdd", | ||
} | ||
`; | ||
|
||
exports[`delete works with self-referential entities 2`] = ` | ||
{ | ||
"anotherObjects": [ | ||
{ | ||
"deleted": true, | ||
"id": "226a20e8-5c18-4423-99ca-eb0df6ff4fdd", | ||
}, | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { gql } from '../../src'; | ||
import { ANOTHER_ID } from '../utils/database/seed'; | ||
import { withServer } from '../utils/server'; | ||
|
||
describe('delete', () => { | ||
it('works with self-referential entities', async () => { | ||
await withServer(async (request) => { | ||
expect( | ||
await request(gql` | ||
mutation DeleteAnotherObject { | ||
deleteAnotherObject(where: { id: "${ANOTHER_ID}" }) | ||
} | ||
`) | ||
).toMatchSnapshot(); | ||
|
||
expect( | ||
await request(gql` | ||
query GetAnotherObject { | ||
anotherObjects(where: { id: "${ANOTHER_ID}", deleted: true }) { | ||
id | ||
deleted | ||
} | ||
} | ||
`) | ||
).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ export const seed = { | |
AnotherObject: [ | ||
{ | ||
id: ANOTHER_ID, | ||
myselfId: ANOTHER_ID, | ||
}, | ||
], | ||
SomeObject: [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters