Skip to content

[F] defineInfoHook

function defineInfoHook(hook): OnInfoHook;

Define a $onInfo hook that contributes extra information about types to IDE hover documentation and tooling. This helper only provides typing; export the result as $onInfo from your library’s entry point.

ParameterType
hookOnInfoHook

OnInfoHook

export const $onInfo = defineInfoHook(({ program, target }) => {
if (target.kind !== "Operation") return undefined;
return [{ content: `Operation ${target.name}` }];
});