Reduce requested category data in queries

This commit is contained in:
schroda
2024-07-01 21:40:27 +02:00
parent 03cfc9b80c
commit 9b8ace003d
19 changed files with 253 additions and 73 deletions

View File

@@ -6,15 +6,15 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { TCategory } from '@/typings.ts';
import { CategoryType } from '@/lib/graphql/generated/graphql.ts';
export const DEFAULT_CATEGORY_ID = 0;
export type CategoryIdInfo = Pick<TCategory, 'id'>;
export type CategoryNameInfo = Pick<TCategory, 'name'>;
export type CategoryDefaultInfo = Pick<TCategory, 'default'>;
export type CategoryUpdateInclusionInfo = Pick<TCategory, 'includeInUpdate'>;
export type CategoryDownloadInclusionInfo = Pick<TCategory, 'includeInDownload'>;
export type CategoryIdInfo = Pick<CategoryType, 'id'>;
export type CategoryNameInfo = Pick<CategoryType, 'name'>;
export type CategoryDefaultInfo = Pick<CategoryType, 'default'>;
export type CategoryUpdateInclusionInfo = Pick<CategoryType, 'includeInUpdate'>;
export type CategoryDownloadInclusionInfo = Pick<CategoryType, 'includeInDownload'>;
export class Categories {
static getIds(categories: CategoryIdInfo[]): number[] {