* fix: add firstname and lastanme to user model * fix: avoid undefined in displayName resolve field * fix: user firstName and lastName instead of firstname lastname * fix: person table proper naming firstName lastName * fix: migrate front with firstName and lastName * fix: make front-graphql-generate not working
51 lines
1.0 KiB
TypeScript
51 lines
1.0 KiB
TypeScript
import { gql } from '@apollo/client';
|
|
|
|
import { SelectedSortType } from '@/filters-and-sorts/interfaces/sorts/interface';
|
|
import {
|
|
PersonOrderByWithRelationInput as People_Order_By,
|
|
PersonWhereInput as People_Bool_Exp,
|
|
SortOrder,
|
|
useGetPeopleQuery,
|
|
} from '~/generated/graphql';
|
|
|
|
export type PeopleSelectedSortType = SelectedSortType<People_Order_By>;
|
|
|
|
export const GET_PEOPLE = gql`
|
|
query GetPeople(
|
|
$orderBy: [PersonOrderByWithRelationInput!]
|
|
$where: PersonWhereInput
|
|
$limit: Int
|
|
) {
|
|
people: findManyPerson(orderBy: $orderBy, where: $where, take: $limit) {
|
|
id
|
|
phone
|
|
email
|
|
city
|
|
firstName
|
|
lastName
|
|
createdAt
|
|
_commentCount
|
|
company {
|
|
id
|
|
name
|
|
domainName
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export function usePeopleQuery(
|
|
orderBy: People_Order_By[],
|
|
where: People_Bool_Exp,
|
|
) {
|
|
return useGetPeopleQuery({
|
|
variables: { orderBy, where },
|
|
});
|
|
}
|
|
|
|
export const defaultOrderBy: People_Order_By[] = [
|
|
{
|
|
createdAt: SortOrder.Desc,
|
|
},
|
|
];
|