/** * Projection: a GraphQL schema → the existing graph primitives * (change: add-contract-graph-projection, GraphQL phase). * * operation node `Query.order` — a field of a root operation type * type node `Order` — an object, interface, input, enum, union or scalar type * `references_schema` operation → its return and argument types; type → the types it names * `implements_endpoint` the function a literal resolver map names → the operation it resolves * * One schema per repository, as one server sees it: every read file merged into one namespace, * `extend` folded into its definition. A name two files define is ambiguous and binds nothing. * Every refusal is disclosed, as in the OpenAPI and protobuf halves. */ import type { CallEdge, FunctionNode } from '../call-graph-types.js'; import type { ResolverMap } from './graphql-resolvers.js'; import { type ImportTarget } from './grpc-registration.js'; /** GraphQL SCHEMA files read per build (client documents cost no slot). */ export declare const MAX_GRAPHQL_FILES = 500; /** GraphQL files of any kind examined per build: a frontend holds many query documents. */ export declare const MAX_GRAPHQL_CANDIDATES: number; /** `synthesizedBy` on an edge bound through a resolver map rather than a call site. */ export declare const GRAPHQL_RESOLVER_BINDING = "graphql-resolver"; export interface UnresolvedResolver { file: string; line: number; root: string; field?: string; /** * The name the resolver entry WROTE at this position and this projection refused to bind. * Carried so a consumer can say WHICH symbol was left unrooted — `find_dead_code` reads it to * keep an unbound resolver out of its high-confidence verdicts. Absent when the entry writes no * name at all (an inline implementation, a map that is not literal). It is the head of what was * written, so on an entry the projection could not FOLLOW it may name something that is not a * function (`RESOLVERS` in `RESOLVERS["list"]`); a consumer matching it by name therefore * over-matches at worst, and never claims the name is a resolver. */ symbol?: string; reason: 'not-literal' | 'unknown-field' | 'inline-implementation' | 'ambiguous-implementation' | 'implementation-not-found'; detail?: string; } export interface GraphqlProjectionInput { files: readonly { path: string; content: string; }[]; /** The resolver maps in the indexed source, for the schema's root type names. */ resolverMaps: (roots: readonly string[]) => readonly ResolverMap[]; /** The code functions of a name a resolver entry could mean. */ resolveImplementation: (map: ResolverMap, name: string) => readonly FunctionNode[]; /** Where an import names a function: its module, one level of re-export followed. */ importTargets?: (fromFile: string, specifier: string, name: string, runtime: 'node' | 'python') => readonly ImportTarget[]; } export interface GraphqlProjection { nodes: FunctionNode[]; edges: CallEdge[]; unreadSpecifications: Array<{ file: string; reason: string; }>; /** GraphQL files that are client documents (operations and fragments), not schemas. */ clientDocuments: string[]; unresolvedResolvers: UnresolvedResolver[]; /** Operations no resolver map binds, as `address (file:line)`. */ unboundOperations: string[]; notAssessed: string[]; /** After-the-fact disclosures that withhold nothing. */ notes: string[]; truncations: Array<{ reason: 'operation-cap' | 'schema-cap' | 'graphql-file-cap'; cap: number; seen: number; }>; } export declare function projectGraphql(input: GraphqlProjectionInput): GraphqlProjection; //# sourceMappingURL=project-graphql.d.ts.map