@backland/schema
Version:
TypeScript schema declaration and validation library with static type inference
10 lines (9 loc) • 477 B
TypeScript
import type { CommonFieldDefinition } from '../_fieldDefinitions';
import type { InferField } from './InferField';
export interface GraphTypeLikeFieldDefinition {
__isGraphType: true;
definition: any;
}
export interface GraphTypeInTypeFieldDefinition extends CommonFieldDefinition<GraphTypeLikeFieldDefinition> {
}
export type InferGraphType<Input> = Input extends unknown ? Input extends GraphTypeLikeFieldDefinition ? InferField<Input['definition']> : never : never;