-
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): Add limit offset paging without connections
- Loading branch information
1 parent
70875f2
commit 5fc3e90
Showing
33 changed files
with
1,418 additions
and
356 deletions.
There are no files selected for viewing
File renamed without changes.
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
227 changes: 227 additions & 0 deletions
227
packages/query-graphql/__tests__/__fixtures__/limit-offset-query-args-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,227 @@ | ||
type Query { | ||
test( | ||
"""Limit or page results.""" | ||
paging: LimitOffsetPaging = {limit: 10} | ||
|
||
"""Specify to filter the records returned.""" | ||
filter: TestQueryFilter = {} | ||
|
||
"""Specify to sort results.""" | ||
sorting: [TestQuerySort!] = [] | ||
): String! | ||
} | ||
|
||
input LimitOffsetPaging { | ||
"""Limit the number of records returned""" | ||
limit: Int | ||
|
||
"""Offset to start returning records from""" | ||
offset: Int | ||
} | ||
|
||
input TestQueryFilter { | ||
and: [TestQueryFilter!] | ||
or: [TestQueryFilter!] | ||
idField: IDFilterComparison | ||
idFieldOption: IDFilterComparison | ||
stringField: StringFieldComparison | ||
stringFieldOptional: StringFieldComparison | ||
booleanField: BooleanFieldComparison | ||
booleanFieldOptional: BooleanFieldComparison | ||
numberField: NumberFieldComparison | ||
numberFieldOptional: NumberFieldComparison | ||
floatField: FloatFieldComparison | ||
floatFieldOptional: FloatFieldComparison | ||
intField: IntFieldComparison | ||
intFieldOptional: IntFieldComparison | ||
timestampField: TimestampFieldComparison | ||
timestampFieldOptional: TimestampFieldComparison | ||
date: DateFieldComparison | ||
dateOptional: DateFieldComparison | ||
} | ||
|
||
input IDFilterComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: ID | ||
neq: ID | ||
gt: ID | ||
gte: ID | ||
lt: ID | ||
lte: ID | ||
like: ID | ||
notLike: ID | ||
iLike: ID | ||
notILike: ID | ||
in: [ID!] | ||
notIn: [ID!] | ||
} | ||
|
||
input StringFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: String | ||
neq: String | ||
gt: String | ||
gte: String | ||
lt: String | ||
lte: String | ||
like: String | ||
notLike: String | ||
iLike: String | ||
notILike: String | ||
in: [String!] | ||
notIn: [String!] | ||
} | ||
|
||
input BooleanFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
} | ||
|
||
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 FloatFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: Float | ||
neq: Float | ||
gt: Float | ||
gte: Float | ||
lt: Float | ||
lte: Float | ||
in: [Float!] | ||
notIn: [Float!] | ||
between: FloatFieldComparisonBetween | ||
notBetween: FloatFieldComparisonBetween | ||
} | ||
|
||
input FloatFieldComparisonBetween { | ||
lower: Float! | ||
upper: Float! | ||
} | ||
|
||
input IntFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: Int | ||
neq: Int | ||
gt: Int | ||
gte: Int | ||
lt: Int | ||
lte: Int | ||
in: [Int!] | ||
notIn: [Int!] | ||
between: IntFieldComparisonBetween | ||
notBetween: IntFieldComparisonBetween | ||
} | ||
|
||
input IntFieldComparisonBetween { | ||
lower: Int! | ||
upper: Int! | ||
} | ||
|
||
input TimestampFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: Timestamp | ||
neq: Timestamp | ||
gt: Timestamp | ||
gte: Timestamp | ||
lt: Timestamp | ||
lte: Timestamp | ||
in: [Timestamp!] | ||
notIn: [Timestamp!] | ||
between: TimestampFieldComparisonBetween | ||
notBetween: TimestampFieldComparisonBetween | ||
} | ||
|
||
""" | ||
`Date` type as integer. Type represents date and time as number of milliseconds from start of UNIX epoch. | ||
""" | ||
scalar Timestamp | ||
|
||
input TimestampFieldComparisonBetween { | ||
lower: Timestamp! | ||
upper: Timestamp! | ||
} | ||
|
||
input DateFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: DateTime | ||
neq: DateTime | ||
gt: DateTime | ||
gte: DateTime | ||
lt: DateTime | ||
lte: DateTime | ||
in: [DateTime!] | ||
notIn: [DateTime!] | ||
between: DateFieldComparisonBetween | ||
notBetween: DateFieldComparisonBetween | ||
} | ||
|
||
""" | ||
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. | ||
""" | ||
scalar DateTime | ||
|
||
input DateFieldComparisonBetween { | ||
lower: DateTime! | ||
upper: DateTime! | ||
} | ||
|
||
input TestQuerySort { | ||
field: TestQuerySortFields! | ||
direction: SortDirection! | ||
nulls: SortNulls | ||
} | ||
|
||
enum TestQuerySortFields { | ||
idField | ||
idFieldOption | ||
stringField | ||
stringFieldOptional | ||
booleanField | ||
booleanFieldOptional | ||
numberField | ||
numberFieldOptional | ||
floatField | ||
floatFieldOptional | ||
intField | ||
intFieldOptional | ||
timestampField | ||
timestampFieldOptional | ||
date | ||
dateOptional | ||
} | ||
|
||
"""Sort Directions""" | ||
enum SortDirection { | ||
ASC | ||
DESC | ||
} | ||
|
||
"""Sort Nulls Options""" | ||
enum SortNulls { | ||
NULLS_FIRST | ||
NULLS_LAST | ||
} |
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.