9c4c325e5a
* remove submodules * add api and ui files * update github actions * use sparse checkout * update node setup * update checkout * update docker * change permissions * update mariadb health check * update changelog
38 lines
783 B
TypeScript
38 lines
783 B
TypeScript
import { QueryHookOptions, QueryResult, useQuery } from '@apollo/client'
|
|
import { gql } from '@apollo/client/core'
|
|
import { FORM_PAGER_FRAGMENT, FormPagerFragment } from '../fragment/form.pager.fragment'
|
|
|
|
interface Data {
|
|
pager: {
|
|
entries: FormPagerFragment[]
|
|
|
|
total: number
|
|
limit: number
|
|
start: number
|
|
}
|
|
}
|
|
|
|
interface Variables {
|
|
start?: number
|
|
limit?: number
|
|
}
|
|
|
|
const QUERY = gql`
|
|
query listForms($start: Int, $limit: Int) {
|
|
pager: listForms(start: $start, limit: $limit) {
|
|
entries {
|
|
...PagerForm
|
|
}
|
|
total
|
|
limit
|
|
start
|
|
}
|
|
}
|
|
|
|
${FORM_PAGER_FRAGMENT}
|
|
`
|
|
|
|
export const useFormPagerQuery = (
|
|
options?: QueryHookOptions<Data, Variables>
|
|
): QueryResult<Data, Variables> => useQuery<Data, Variables>(QUERY, options)
|