@sparklink-pro/apant
Version:
Apollo & Antd tools
27 lines • 1.13 kB
TypeScript
import { GraphQLObject, GraphQLType } from '../definitions';
export declare const defaultLabelProperty = "_name";
/**
* This hook is used to get the type and all its configuration/options ??
* It can be used to get the label, the search keywords,
* Or for example the selectOptions if used as a select in a form.
*/
export declare function useType({ type }: {
type: GraphQLType;
}): {
getLabel: (object: GraphQLObject) => any;
getOrder: () => string | {
[field: string]: "asc" | "desc";
} | ((a: GraphQLObject, b: GraphQLObject) => number);
getId: (object: GraphQLObject) => any;
getForm: (name: string) => import("../definitions").FormConfigurationType | undefined;
getAdmin: () => import("../definitions").TypeConfigurationAdmin | undefined;
getSearch: () => string | string[] | {
custom: (object: GraphQLObject, search: string, context?: any) => boolean;
} | ((object: GraphQLObject, context?: any) => string) | undefined;
getSelectOptions: () => {
label: any;
fragment: any;
};
};
export default useType;
//# sourceMappingURL=useType.d.ts.map