Skip to content

[F] $onEmit

function $onEmit(context): Promise<void>;

TypeSpec emitter hook that writes GraphQL SDL for each @schema namespace, or for the global namespace when no schema is declared.

Schemas without GraphQL operations produce no file. Dry runs still build and render schemas for diagnostics, but do not write output.

ParameterType
contextEmitContext<GraphQLEmitterOptions>

Promise<void>