Use Graphql types in FE and complete mappers removal (#348)
Fix Typescript build issues
This commit is contained in:
@ -1,26 +1,7 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { DocumentNode } from 'graphql';
|
||||
|
||||
import {
|
||||
AnyEntity,
|
||||
BoolExpType,
|
||||
GqlType,
|
||||
UnknownType,
|
||||
} from '@/utils/interfaces/generic.interface';
|
||||
|
||||
export type SearchConfigType<
|
||||
SearchType extends AnyEntity | UnknownType = UnknownType,
|
||||
> = SearchType extends UnknownType
|
||||
? {
|
||||
query: DocumentNode;
|
||||
template: (searchInput: string) => any;
|
||||
resultMapper: (data: any) => any;
|
||||
}
|
||||
: {
|
||||
query: DocumentNode;
|
||||
template: (searchInput: string) => BoolExpType<SearchType>;
|
||||
resultMapper: (data: GqlType<SearchType>) => {
|
||||
value: SearchType;
|
||||
render: (value: SearchType) => ReactNode;
|
||||
};
|
||||
};
|
||||
export type SearchConfigType = {
|
||||
query: DocumentNode;
|
||||
template: (searchInput: string) => any;
|
||||
resultMapper: (data: any) => any;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user