APQ resolver that verifies hashes before caching.
-
resolve(params: { query?: string; extensions?: Record<string, unknown>; }): Promise<ApqResolveResult>
Resolve APQ for a request.
Error thrown when the graphql runtime cannot be loaded.
- name: string
-
specifier: string
The specifier that failed to load.
Error thrown when schema construction or resolver attachment fails.
GraphQL service implementation.
-
cachedDocumentCount(): number
Report the number of cached documents.
-
clearCache(): void
Clear the document cache.
-
endpoint(): string
The endpoint path where GraphQL is served.
-
execute(): Promise<GraphqlExecutionOutcome>params: GraphqlRequestParams,requestContext?: IRequestContext,method?: "GET" | "POST"
Execute a GraphQL request.
-
subscribe(): Promise<GraphqlSubscriptionOutcome>params: GraphqlRequestParams,context?: GraphqlOperationContext
Subscribe to a GraphQL operation (query, mutation, or subscription).
Adapt a graphql module to the internal runtime interface.
Create a validation rule that limits query depth.
Encode a keep-alive comment.
Encode a complete SSE event with the mandatory empty data: field.
Encode a next SSE event carrying a GraphQL execution result.
Extract persisted query info from request extensions.
Generate a GraphiQL HTML page.
Create a GraphQL plugin.
Load the graphql runtime, either from an injected module or lazily.
Compute a SHA-256 hash of the query string and return lowercase hex.
The entry type for a SUBSCRIPTION resolver stored in a
TypeResolverMap.
-
resolve: AnyFieldResolver
Maps each emitted payload to the field value. Optional.
-
subscribe(): AsyncIterable<unknown> | Promise<AsyncIterable<unknown>>source: unknown,args: Record<string, unknown>,context: unknown,info: unknown
Produces the event source for this subscription field.
Default context shape that resolvers receive.
-
connection: GraphqlConnectionInfo
The WebSocket connection info. Present only over the WS transport.
-
requestContext: IRequestContext
The HTTP request context. Absent over the WebSocket transport.
-
services: IServiceRegistry
The live service registry (request-scoped over HTTP, plugin-level over WS).
-
tenant: ITenant
The resolved tenant, when tenancy resolved one.
-
user: IPrincipal
The authenticated principal, when the auth middleware published one.
APQ (Automatic Persisted Queries) options.
-
maxEntries: number
Maximum entries in the in-memory LRU fallback. Default
1000. -
ttlSeconds: number
TTL in seconds for cache-store entries. Default
300.
Code-first arm options.
- resolvers: never
-
schema: GraphqlSchemaLike
Pre-built schema from the application.
-
typeDefs: never
Disallow schema-first options.
Information about a WebSocket connection used for subscription operations.
-
connectionParams: Record<string, unknown>
The payload sent with
connection_init, if any. -
data: Map<string, unknown>
Per-connection application state.
-
headers: Headers
The upgrade request headers.
-
id: string
Unique connection identifier.
-
protocol: string
The negotiated subprotocol, when one was selected.
-
query: Readonly<Record<string, string>>
Query string parameters from the upgrade request.
Context input for custom context building.
-
connection: GraphqlConnectionInfo
Present when the operation arrives over a WebSocket subscription.
- request: unknown
- services: unknown
The execution result as specified by the GraphQL spec.
-
data: Record<string, unknown> | null
The data returned by the execution, or null if an error occurred.
-
errors: GraphqlFormattedError[]
Errors encountered during execution, or undefined if none.
Formatted GraphQL error as returned to the client.
-
extensions: Record<string, unknown>
Optional extensions for application-specific error codes.
-
locations: Array<{ line: number; column: number; }>
Optional locations in the query document.
-
message: string
Human-readable error message.
-
path: Array<string | number>
Optional path to the field where the error occurred.
The structural shape of a graphql@16 module — the external boundary (M70i X6-3).
-
GraphQLError: new () => unknownmessage: string,options?: undefined
The graphql
GraphQLErrorconstructor.optionsisundefined(not a modeled object) so the realtypeof GraphQLError— whose constructor isnew (message: string, options?: GraphQLErrorOptions)— stays assignable: contravariance requires the facade'soptionsto be assignable toGraphQLErrorOptions | undefined, andundefinedis. -
NoSchemaIntrospectionCustomRule: unknown
The no-schema-introspection validation rule.
-
buildSchema(source: unknown): GraphqlSchemaLike
Build a schema from SDL source.
-
execute(args: { schema: GraphqlSchemaLike; document: unknown; rootValue?: unknown; contextValue?: unknown; variableValues?: unknown; operationName?: string | null | undefined; }): unknown
Execute a document; the result carries
dataand/orerrors. -
getOperationAST(): unknowndocument: unknown,operationName?: string | null | undefined
Extract the operation definition for
operationNamefrom a document. -
parse(source: unknown): unknown
Parse a query/mutation/subscription document.
-
specifiedRules: readonly unknown[]
The specified (built-in) validation rules.
-
subscribe(args: { schema: GraphqlSchemaLike; document: unknown; rootValue?: unknown; contextValue?: unknown; variableValues?: unknown; operationName?: string | null | undefined; }): unknown
Subscribe to a document; the result is an async iterable or a single error result.
-
validate(): unknownschema: GraphqlSchemaLike,document: unknown,rules?: readonly unknown[]
Validate a document against a schema; returns validation errors.
-
validateSchema(schema: GraphqlSchemaLike): unknown
Validate a schema; returns schema errors.
Context for a subscription operation, carrying either an HTTP request context or a WebSocket connection info.
-
connection: GraphqlConnectionInfo
The WebSocket connection info (supplied by the WS path).
-
requestContext: IRequestContext
The HTTP request context (supplied by the SSE path).
Parameters for a GraphQL execution request.
-
extensions: Record<string, unknown>
Optional extensions carried with the request.
-
operationName: string
Operation name for documents with multiple operations.
-
query: string
The GraphQL query string.
-
variables: Record<string, unknown>
Variables as a record of unknown values (passed through verbatim).
Custom scalar resolver methods.
-
parseLiteral(): unknownnode: unknown,variables?: Record<string, unknown> | null
Parse a literal AST value (inline argument).
-
parseValue(value: unknown): unknown
Parse a client input value (variable).
-
serialize(value: unknown): unknown
Serialize an internal value to JSON-safe output.
Structural facade for a graphql@16 scalar type, exposing the three settable resolver properties.
Schema-first arm options.
-
resolvers: ResolverMap
Resolver map to attach to the schema.
-
schema: never
Disallow code-first option.
-
typeDefs: string
SDL string defining the schema.
Structural facade for a graphql@16 schema.
- getDirective(name: string): GraphqlDirectiveLike | null | undefined
- getDirectives(): readonly GraphqlDirectiveLike[]
- getMutationType(): GraphqlObjectTypeLike | null | undefined
- getPossibleTypes(abstractType: GraphqlAbstractTypeLike): readonly GraphqlObjectTypeLike[]
- getQueryType(): GraphqlObjectTypeLike | null | undefined
- getSubscriptionType(): GraphqlObjectTypeLike | null | undefined
- getType(name: string): GraphqlNamedTypeLike | null | undefined
- toAST(): unknown
SSE transport options for GraphQL subscriptions.
-
heartbeatMs: number
Milliseconds between
:keep-alivecomment frames.0disables. Default0. -
path: string
The SSE endpoint path; defaults to
`${path}/stream`.
Subscription transport configuration.
-
sse: GraphqlSseTransportOptions | false
SSE transport options.
falsedisables SSE subscriptions;{}enables with defaults. Present by default. -
websocket: GraphqlWsTransportOptions | false
WebSocket transport options.
falsedisables WS subscriptions;{}enables with defaults. Absent defaults to enabled whenCAPABILITIES.WEBSOCKETis available.
WebSocket transport options for GraphQL subscriptions.
-
connectionInitWaitMs: number
Milliseconds to wait for
connection_initbefore closing with code 4408. Default3000. -
heartbeatMs: number
Milliseconds between protocol
pingframes.0disables. Default0. -
onConnect: (info: GraphqlConnectionInfo) => false | void | Promise<false | void>
Called on
connection_initBEFORE the ack. Returningfalsecloses the socket with4403: Forbidden. May write toconn.datato establish identity for the default resolver context. -
path: string
The WebSocket endpoint path; defaults to
`${path}/ws`.
The surface the transports consume.
The GraphQL service contract.
-
cachedDocumentCount: number
Report the number of cached documents.
-
endpoint: string
The endpoint path where GraphQL is served.
-
execute(): Promise<GraphqlExecutionOutcome>params: GraphqlRequestParams,requestContext?: IRequestContext,method?: "GET" | "POST"
Execute a GraphQL request.
-
subscribe(): Promise<GraphqlSubscriptionOutcome>params: GraphqlRequestParams,context?: GraphqlOperationContext
Subscribe to a GraphQL operation (query, mutation, or subscription).
A subscription field's resolver pair.
-
resolve: FieldResolver<TSource, TContext, TArgs>
Maps each emitted payload to the field value. Optional.
-
subscribe: () => AsyncIterable<unknown> | Promise<AsyncIterable<unknown>>source: TSource,args: TArgs,context: TContext,info: unknown
Produces the event source for this subscription field.
The entry type for a field resolver stored in a TypeResolverMap.
| { ok: false; message: string; code: string; status: number; }
The result of resolving APQ for a request.
& { path?: string; graphiql?: boolean; introspection?: boolean; maxDepth?: number; maxNodes?: number; validationRules?: unknown[]; maskInternalErrors?: boolean; formatError?: (error: unknown) => unknown; documentCacheSize?: number; buildContext?: (input: GraphqlContextInput) => unknown | Promise<unknown>; rootValue?: unknown; graphqlModule?: GraphqlModuleLike; subscriptions?: GraphqlSubscriptionsOptions; apq?: GraphqlApqOptions; maxBatchSize?: number; }
Union of schema construction options — mutually exclusive arms.
| { kind: "single"; status: number; result: GraphqlExecutionResult; }
| { kind: "stream"; status: number; stream: AsyncIterable<GraphqlExecutionResult>; }
Discriminated outcome of a subscription operation.
Resolver map for schema-first construction.
The resolver entries for one object or interface type.
The protocol identifier.
Usage
import * as mod from "graphql-plugin/src/index.ts";