/** * Graph Validation Engine * * Validates a parsed graph schema for correctness, checking field types, * directive references, relation targets, and modifier consistency. * * @packageDocumentation */ import type { ParsedGraph, ParsedEntity, ValidationResult, ValidationError } from './types.js'; /** * Validate a single entity within the graph * * @param entity - The entity to validate * @param graph - The full graph for cross-entity checks * @returns Errors and warnings found */ export declare function validateEntity(entity: ParsedEntity, graph: ParsedGraph): { errors: ValidationError[]; warnings: ValidationError[]; }; /** * Validate an entire parsed graph schema * * Checks all entities for: * - Unknown field types * - Invalid directive field references ($partitionBy, $index, $fts, $vector) * - Relation targets referencing non-existent entities * - Conflicting modifiers (! + ?) * * @param graph - The parsed graph to validate * @returns Validation result with errors and warnings * * @example * ```ts * const schema = Graph({ * User: { name: 'string', email: 'string!' }, * Post: { title: 'string', author: '->User' }, * }) * const result = validateGraph(schema) * if (!result.valid) { * console.error('Validation errors:', result.errors) * } * ``` */ export declare function validateGraph(graph: ParsedGraph): ValidationResult; //# sourceMappingURL=validate.d.ts.map