-
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.
break: Extend query builders again (#135)
* break: Extend query builders again * fixes --------- Co-authored-by: Nicola Marcacci Rossi <[email protected]>
- Loading branch information
1 parent
bc6e8f7
commit 4d0122e
Showing
4 changed files
with
49 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`queries getEntityRelationsQuery applies filters 1`] = ` | ||
"query UpdateSomeObjectRelations { | ||
another: anotherObjects(orderBy: [{ name: ASC }]) { | ||
"query SelectSomeObjectRelations($anotherWhere: AnotherObjectWhere, $anotherLimit: Int) { | ||
another: anotherObjects(where: $anotherWhere, limit: $anotherLimit, orderBy: [{ name: ASC }]) { | ||
id | ||
display: name | ||
} | ||
}" | ||
`; |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { getEditEntityRelationsQuery } from '../../src'; | ||
import { getActionableRelations, getSelectEntityRelationsQuery } from '../../src'; | ||
import { models } from '../utils/models'; | ||
|
||
describe('queries', () => { | ||
describe('getEntityRelationsQuery', () => { | ||
it('applies filters', () => { | ||
expect(getEditEntityRelationsQuery(models.getModel('SomeObject', 'entity'), 'update')).toMatchSnapshot(); | ||
const model = models.getModel('SomeObject', 'entity'); | ||
expect(getSelectEntityRelationsQuery(model, getActionableRelations(model, 'update'))).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |