import type { RawTypesConfig } from "@graphql-codegen/visitor-plugin-common"; /** * Mock data generation options (user input - all fields optional). * * Mock generation uses two complementary depth controls: * - `maxDepth`: Limits total nesting depth across ALL types (A → B → C → D stops at depth limit) * - `maxTypeRecursion`: Limits how many times the SAME type can appear in a chain (User → User → User) * * Both conditions must pass for generation to continue: * `depth < maxDepth && typeVisitCount[type] < maxTypeRecursion` */ export type RawMockConfig = { /** * Maximum total nesting depth across all types. * Prevents deep chains like: Query → Book → Author → Publisher → Address → Country → ... * @default 9 * @example * // With maxDepth: 3, generation stops at depth 3 regardless of type * // Query(0) → Book(1) → Author(2) → Publisher(3) → stops */ maxDepth?: number | undefined; /** * Maximum times a specific type can be visited in a single path. * Prevents same-type recursion like: User → User → User → ... * @default 2 * @example * // With maxTypeRecursion: 2 * // User(visit:1) → friends: User(visit:2) → friends: undefined (stops) */ maxTypeRecursion?: number | undefined; /** * Number of elements to generate for array/list fields. * @default 3 */ listLength?: number | undefined; /** * Default values for GraphQL scalar types. */ defaultValues?: { String?: string | undefined; Int?: number | undefined; Float?: number | undefined; Boolean?: boolean | undefined; ID?: string | undefined; CustomScalar?: { /** * CustomScalar default expression * The value must be an JavaScript expression. * If you want to put a string value, you must put it in quotes * @example * ```js * CustomScalar: { * Digit: "1", * DateYYYYMMDD: "'2022-02-03'", * ISODateTime: "new Date().toISOString()" * } * ``` */ [key: string]: string; }; } | undefined; }; /** * Code generation config (user input - all fields optional). * Used by graphql-codegen plugin to generate mock factory functions. */ export type RawConfig = { /** * Path to type definitions file generated by graphql-codegen client preset. * Required for TypeScript output. * @example "typeFile: "./graphql" */ typesFile?: string | undefined; /** * Whether to skip __typename field in generated types. * @see https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#skiptypename */ skipTypename?: RawTypesConfig["skipTypename"] | undefined; /** * Naming convention for generated types. * @see https://the-guild.dev/graphql/codegen/plugins/typescript/typescript#namingconvention */ namingConvention?: RawTypesConfig["namingConvention"] | undefined; /** * Prefix for generated type names. */ typesPrefix?: RawTypesConfig["typesPrefix"] | undefined; /** * Suffix for generated type names. */ typesSuffix?: RawTypesConfig["typesSuffix"] | undefined; /** * Mock data generation options. * Controls depth limits, list lengths, and default scalar values. */ mock?: RawMockConfig | undefined; }; /** * Default values for mock generation options. */ export declare const MockDefaults: { /** @see RawMockConfig.maxDepth */ readonly maxDepth: 9; /** @see RawMockConfig.maxTypeRecursion */ readonly maxTypeRecursion: 2; /** @see RawMockConfig.listLength */ readonly listLength: 3; }; /** * Default values for GraphQL scalar types. */ export declare const DefaultValues: { readonly String: "string"; readonly Int: 12; readonly Float: 12.3; readonly Boolean: true; readonly ID: "xxxx-xxxx-xxxx-xxxx"; }; /** * Mock data generation options (normalized - all fields required). * This is the internal config type with defaults applied. * * @see RawMockConfig for user-facing config with optional fields */ export type MockConfig = { /** * Maximum total nesting depth across all types. * @see RawMockConfig.maxDepth */ maxDepth: number; /** * Maximum times a specific type can be visited in a single path. * @see RawMockConfig.maxTypeRecursion */ maxTypeRecursion: number; /** * Number of elements to generate for array/list fields. */ listLength: number; /** * Default values for GraphQL scalar types. */ defaultValues: { /** Default value for String scalar */ String: string; /** Default value for Int scalar */ Int: number; /** Default value for Float scalar */ Float: number; /** Default value for Boolean scalar */ Boolean: boolean; /** Default value for ID scalar */ ID: string; /** * Default values for custom scalars. * Key is the scalar name, value is a JavaScript expression. */ CustomScalar?: { [key: string]: string; }; }; }; /** * Code generation config (normalized - all fields required). * This is the internal config type with defaults applied. * * @see RawConfig for user-facing config with optional fields */ export type Config = { /** Path to type definitions file */ typesFile: string; /** Whether to skip __typename field */ skipTypename: Exclude; /** Prefix for generated type names */ typesPrefix: Exclude; /** Suffix for generated type names */ typesSuffix: Exclude; /** Naming convention for generated types */ namingConvention: Exclude; /** Mock data generation options (normalized) */ mock: MockConfig; }; export declare function validateConfig(rawConfig: unknown, outputType?: "typescript" | "javascript"): asserts rawConfig is RawConfig; export declare function normalizeConfig(rawConfig: RawConfig): Config; //# sourceMappingURL=config.d.ts.map