-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graphql): Allow specifying allowed comparisons on filterable fields
- Loading branch information
1 parent
ffe2ae9
commit ced2792
Showing
14 changed files
with
240 additions
and
66 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
85 changes: 85 additions & 0 deletions
85
packages/query-graphql/__tests__/__fixtures__/filter-allowed-comparisons-input-type.graphql
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,85 @@ | ||
type Query { | ||
test(input: TestComparisonDtoFilter!): Int! | ||
} | ||
|
||
input TestComparisonDtoFilter { | ||
and: [TestAllowedComparisonFilter!] | ||
or: [TestAllowedComparisonFilter!] | ||
id: NumberFieldComparison | ||
boolField: TestAllowedComparisonBoolFieldFilterComparison | ||
dateField: TestAllowedComparisonDateFieldFilterComparison | ||
floatField: TestAllowedComparisonFloatFieldFilterComparison | ||
intField: TestAllowedComparisonIntFieldFilterComparison | ||
numberField: TestAllowedComparisonNumberFieldFilterComparison | ||
stringField: TestAllowedComparisonStringFieldFilterComparison | ||
} | ||
|
||
input TestAllowedComparisonFilter { | ||
and: [TestAllowedComparisonFilter!] | ||
or: [TestAllowedComparisonFilter!] | ||
id: NumberFieldComparison | ||
boolField: TestAllowedComparisonBoolFieldFilterComparison | ||
dateField: TestAllowedComparisonDateFieldFilterComparison | ||
floatField: TestAllowedComparisonFloatFieldFilterComparison | ||
intField: TestAllowedComparisonIntFieldFilterComparison | ||
numberField: TestAllowedComparisonNumberFieldFilterComparison | ||
stringField: TestAllowedComparisonStringFieldFilterComparison | ||
} | ||
|
||
input NumberFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: Float | ||
neq: Float | ||
gt: Float | ||
gte: Float | ||
lt: Float | ||
lte: Float | ||
in: [Float!] | ||
notIn: [Float!] | ||
between: NumberFieldComparisonBetween | ||
notBetween: NumberFieldComparisonBetween | ||
} | ||
|
||
input NumberFieldComparisonBetween { | ||
lower: Float! | ||
upper: Float! | ||
} | ||
|
||
input TestAllowedComparisonBoolFieldFilterComparison { | ||
is: Boolean | ||
} | ||
|
||
input TestAllowedComparisonDateFieldFilterComparison { | ||
eq: DateTime | ||
neq: DateTime | ||
} | ||
|
||
""" | ||
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. | ||
""" | ||
scalar DateTime | ||
|
||
input TestAllowedComparisonFloatFieldFilterComparison { | ||
gt: Float | ||
gte: Float | ||
} | ||
|
||
input TestAllowedComparisonIntFieldFilterComparison { | ||
lt: Int | ||
lte: Int | ||
} | ||
|
||
input TestAllowedComparisonNumberFieldFilterComparison { | ||
eq: Float | ||
neq: Float | ||
gt: Float | ||
gte: Float | ||
lt: Float | ||
lte: Float | ||
} | ||
|
||
input TestAllowedComparisonStringFieldFilterComparison { | ||
like: String | ||
notLike: String | ||
} |
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
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
Oops, something went wrong.