IO-899 Refactor ccc paginated query

This commit is contained in:
Patrick Fic
2021-04-13 17:07:24 -07:00
parent 18531dad6a
commit f54d76a83d
18 changed files with 143 additions and 36 deletions

View File

@@ -144,23 +144,16 @@ export const QUERY_CONTRACT_BY_PK = gql`
export const QUERY_ACTIVE_CONTRACTS_PAGINATED = gql`
query QUERY_ACTIVE_CONTRACTS_PAGINATED(
$search: String
$offset: Int
$limit: Int
$order: [cccontracts_order_by!]!
$start: timestamptz
$end: timestamptz
) {
cccontracts(
search_cccontracts(
args: { search: $search }
offset: $offset
limit: $limit
order_by: $order
where: {
_or: [
{ actualreturn: { _lte: $end } }
{ actualreturn: { _is_null: true } }
]
start: { _gte: $start }
}
) {
agreementnumber
courtesycarid
@@ -171,7 +164,6 @@ export const QUERY_ACTIVE_CONTRACTS_PAGINATED = gql`
jobid
job {
id
ro_number
ownr_fn
ownr_ln
@@ -190,7 +182,7 @@ export const QUERY_ACTIVE_CONTRACTS_PAGINATED = gql`
plate
}
}
cccontracts_aggregate {
search_cccontracts_aggregate(args: { search: $search }) {
aggregate {
count(distinct: true)
}