/** A resolver of one field, `Type.field`: its parent object, its arguments, and the request's handler context. */ export type GraphqlResolver = (source: Record, args: Record, ctx: C) => unknown; /** What a pack's `semantics/graphql.ts` exports as `graphql`. */ export type GraphqlPart = { /** The root operations derived from the SDL, for dispatch ownership and gap reporting. */ operations?: ReadonlyArray<{ id: string; kind: 'query' | 'mutation'; field: string; }>; /** resolvers by `Type.field` (`Query.repository`, `PullRequest.state`) */ resolvers: Record>; /** per type, a GraphQL field name → the object's field that holds it (`nameWithOwner` → `full_name`) */ aliases?: Record>; /** per type, the object's fields the default resolver may read as they are */ stored?: Record; }; /** An error a resolver answers, with the vendor's `type` for it (GitHub's NOT_FOUND, UNPROCESSABLE). */ export declare class GraphqlError extends Error { readonly type?: string | undefined; constructor(message: string, type?: string | undefined); } type GraphqlLib = typeof import('graphql'); export type GraphqlLibraryLoader = () => Promise; /** A GraphQL endpoint over a schema and a pack's part: answers a request's `{query, variables, operationName}`. The * context each resolver receives is made per request (the handler context). `unmodeled` answers a query selecting a * field nothing models; `mutationRefused`, when given, a mutation the World may not make (a read-only twin). */ export declare function graphqlEndpoint(options: { sdl: string; part: GraphqlPart; /** The generated pack fetch's lazy import, resolving the library from the pack that declares it. */ loadLibrary?: GraphqlLibraryLoader; context: (request: Request) => Promise; unmodeled: (field: { type: string; field: string; }) => Response; mutationRefused?: (request: Request) => Response | undefined; }): (request: Request) => Promise; export {};