@backland/schema
Version:
TypeScript schema declaration and validation library with static type inference
333 lines (332 loc) • 11.2 kB
TypeScript
export declare const objectMocks: {
object1: import("../ObjectType").ObjectType<{
age: "int?";
favorites: "[string]";
name: "string";
sex: {
readonly enum: readonly ["m", "f", "o"];
};
}, {
age: "int?";
favorites: "[string]";
name: "string";
sex: {
readonly enum: readonly ["m", "f", "o"];
};
}>;
object2: import("../ObjectType").ObjectType<{
name: "string";
sub: import("../ObjectType").ObjectType<{
age: "int?";
favorites: "[string]";
name: "string";
sex: {
readonly enum: readonly ["m", "f", "o"];
};
}, {
age: "int?";
favorites: "[string]";
name: "string";
sex: {
readonly enum: readonly ["m", "f", "o"];
};
}>;
}, {
name: "string";
sub: import("../ObjectType").ObjectType<{
age: "int?";
favorites: "[string]";
name: "string";
sex: {
readonly enum: readonly ["m", "f", "o"];
};
}, {
age: "int?";
favorites: "[string]";
name: "string";
sex: {
readonly enum: readonly ["m", "f", "o"];
};
}>;
}>;
stringDefTypes: {
readonly stringDefBoolean: "boolean";
readonly stringDefBooleanList: "[boolean]";
readonly stringDefBooleanListOptional: "[boolean]?";
readonly stringDefCursor: "cursor";
readonly stringDefCursorList: "[cursor]";
readonly stringDefCursorListOptional: "[cursor]?";
readonly stringDefDate: "date";
readonly stringDefDateList: "[date]";
readonly stringDefDateListOptional: "[date]?";
readonly stringDefEmail: "email";
readonly stringDefEmailList: "[email]";
readonly stringDefEmailListOptional: "[email]?";
readonly stringDefFloat: "float";
readonly stringDefFloatList: "[float]";
readonly stringDefFloatListOptional: "[float]?";
readonly stringDefInt: "int";
readonly stringDefIntList: "[int]";
readonly stringDefIntListOptional: "[int]?";
readonly stringDefString: "string";
readonly stringDefStringList: "[string]";
readonly stringDefStringListOptional: "[string]?";
readonly stringDefUlid: "ulid";
readonly stringDefUlidList: "[ulid]";
readonly stringDefUlidListOptional: "[ulid]?";
readonly stringDefUnknown: "unknown";
readonly stringDefUnknownList: "[unknown]";
readonly stringDefUnknownListOptional: "[unknown]?";
};
typeDefs: {
readonly stringDefBoolean: "boolean";
readonly stringDefBooleanList: "[boolean]";
readonly stringDefBooleanListOptional: "[boolean]?";
readonly stringDefCursor: "cursor";
readonly stringDefCursorList: "[cursor]";
readonly stringDefCursorListOptional: "[cursor]?";
readonly stringDefDate: "date";
readonly stringDefDateList: "[date]";
readonly stringDefDateListOptional: "[date]?";
readonly stringDefEmail: "email";
readonly stringDefEmailList: "[email]";
readonly stringDefEmailListOptional: "[email]?";
readonly stringDefFloat: "float";
readonly stringDefFloatList: "[float]";
readonly stringDefFloatListOptional: "[float]?";
readonly stringDefInt: "int";
readonly stringDefIntList: "[int]";
readonly stringDefIntListOptional: "[int]?";
readonly stringDefString: "string";
readonly stringDefStringList: "[string]";
readonly stringDefStringListOptional: "[string]?";
readonly stringDefUlid: "ulid";
readonly stringDefUlidList: "[ulid]";
readonly stringDefUlidListOptional: "[ulid]?";
readonly stringDefUnknown: "unknown";
readonly stringDefUnknownList: "[unknown]";
readonly stringDefUnknownListOptional: "[unknown]?";
readonly enumStringArray: readonly ["a", "b", "c"];
readonly fieldDefAsType: import("..").FieldType<string, "string", import("../fields/StringField").StringFieldDef | undefined, 1, 1, undefined, {}>;
readonly objectObjectAsType: any;
readonly objectTypeName: {
readonly def: {
name: "string";
sub: import("../ObjectType").ObjectType<{
age: "int?";
favorites: "[string]";
name: "string";
sex: {
readonly enum: readonly ["m", "f", "o"];
};
}, {
age: "int?";
favorites: "[string]";
name: "string";
sex: {
readonly enum: readonly ["m", "f", "o"];
};
}>;
};
readonly type: "object";
};
readonly stringFieldDefinition: {
readonly list: true;
readonly optional: true;
readonly type: "cursor";
};
};
};
export declare const productsStatusEnum: ["published", "draft"];
export declare const DimensionsType: import("../ObjectType").ObjectType<{
height: "string?";
length: "string?";
weight: "string?";
width: "string?";
}, {
height: "string?";
length: "string?";
weight: "string?";
width: "string?";
}>;
export declare const ProductImageMapType: import("../ObjectType").ObjectType<{
allowZoom: "boolean?";
key: "string?";
kind: "string?";
}, {
allowZoom: "boolean?";
key: "string?";
kind: "string?";
}>;
export declare const BreadCrumbType: import("../ObjectType").ObjectType<{
active: "boolean?";
id: "ID";
name: "string";
parentId: "ID?";
}, {
active: "boolean?";
id: "ID";
name: "string";
parentId: "ID?";
}>;
export declare const StockType: import("../ObjectType").ObjectType<{
available: "boolean";
count: "float?";
maxCartQty: "float?";
track: {
description: string;
type: "boolean";
};
}, {
available: "boolean";
count: "float?";
maxCartQty: "float?";
track: {
description: string;
type: "boolean";
};
}>;
export declare const ProductType: import("../GraphType/GraphType").GraphType<{
readonly object: {
readonly sku: "string";
readonly storeId: "ID";
readonly title: "string";
readonly stock: import("../ObjectType").ObjectType<{
available: "boolean";
count: "float?";
maxCartQty: "float?";
track: {
description: string;
type: "boolean";
};
}, {
available: "boolean";
count: "float?";
maxCartQty: "float?";
track: {
description: string;
type: "boolean";
};
}>;
readonly shortDescription: "string?";
readonly brand: "string";
readonly detailsUrl: "string?";
readonly alcoholic: {
readonly boolean: true;
readonly defaultValue: false;
};
readonly thumbUrl: "string?";
readonly breadcrumb: {
readonly type: import("../ObjectType").ObjectType<{
active: "boolean?";
id: "ID";
name: "string";
parentId: "ID?";
}, {
active: "boolean?";
id: "ID";
name: "string";
parentId: "ID?";
}>;
readonly list: true;
};
readonly mapOfImages: {
readonly type: import("../ObjectType").ObjectType<{
allowZoom: "boolean?";
key: "string?";
kind: "string?";
}, {
allowZoom: "boolean?";
key: "string?";
kind: "string?";
}>;
readonly list: true;
readonly optional: true;
};
readonly attributes: "record?";
readonly currentPrice: "float";
readonly priceFrom: "float?";
readonly sellPrice: "float";
readonly dimensions: {
readonly type: import("../ObjectType").ObjectType<{
height: "string?";
length: "string?";
weight: "string?";
width: "string?";
}, {
height: "string?";
length: "string?";
weight: "string?";
width: "string?";
}>;
readonly optional: true;
};
};
}>;
export declare const ProductResolver: {
description?: import("graphql/jsutils/Maybe").Maybe<string>;
subscribe?: import("graphql").GraphQLFieldResolver<any, import("../Resolver").ResolverContextBase, {
id: string;
}, unknown> | undefined;
deprecationReason?: import("graphql/jsutils/Maybe").Maybe<string>;
extensions?: import("graphql/jsutils/Maybe").Maybe<Readonly<import("graphql").GraphQLFieldExtensions<any, import("../Resolver").ResolverContextBase, {
id: string;
}>>>;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").FieldDefinitionNode>;
__graphTypeId: string;
__isRelation: boolean;
__isResolver: true;
__relatedToGraphTypeId: string;
args: any;
argsDef: any;
argsType: any;
asObjectField: (name?: string | undefined) => import("graphql").GraphQLField<any, any, any>;
kind: import("../Resolver").ResolverKind;
name: string;
payloadType: any;
type: any;
typeDef: any;
resolve: <Root>(root: Root, args: {
id: string;
}, context: import("../Resolver").ResolverContextBase, info: import("graphql").GraphQLResolveInfo) => import("@backland/utils").MaybePromise<{
title: string;
breadcrumb: {
name: string;
id: string;
active?: boolean | undefined;
parentId?: string | undefined;
}[];
sku: string;
storeId: string;
stock: {
available: boolean;
track: boolean;
count?: number | undefined;
maxCartQty?: number | undefined;
};
brand: string;
currentPrice: number;
sellPrice: number;
alcoholic: boolean;
shortDescription?: string | undefined;
detailsUrl?: string | undefined;
thumbUrl?: string | undefined;
attributes?: {
[K: string]: any;
} | undefined;
priceFrom?: number | undefined;
mapOfImages?: {
kind?: string | undefined;
key?: string | undefined;
allowZoom?: boolean | undefined;
}[] | undefined;
dimensions?: {
length?: string | undefined;
weight?: string | undefined;
height?: string | undefined;
width?: string | undefined;
} | undefined;
}>;
} & {
resolver?: undefined;
};