UNPKG

@pothos/plugin-tracing

Version:

A Pothos plugin for tracing and logging resolver invocations

27 lines (26 loc) 1.39 kB
import type { FieldNullability, InputFieldMap, InputShapeFromFields, PothosOutputFieldConfig, SchemaTypes, TypeParam } from '@pothos/core'; import type { PothosTracingPlugin } from './index.js'; import type { TracingFieldOptions, TracingFieldWrapper } from './types.js'; declare global { export namespace PothosSchemaTypes { interface Plugins<Types extends SchemaTypes> { tracing: PothosTracingPlugin<Types>; } interface SchemaBuilderOptions<Types extends SchemaTypes> { tracing?: { default: Types["Tracing"] | ((config: PothosOutputFieldConfig<Types>) => TracingFieldOptions<Types, unknown, Record<string, unknown>>); wrap: TracingFieldWrapper<Types>; }; } interface UserSchemaTypes { Tracing: unknown; } interface ExtendDefaultTypes<PartialTypes extends Partial<UserSchemaTypes>> { Tracing: unknown extends PartialTypes["Tracing"] ? boolean : PartialTypes["Tracing"]; } interface FieldOptions<Types extends SchemaTypes, ParentShape, Type extends TypeParam<Types>, Nullable extends FieldNullability<Type>, Args extends InputFieldMap, ResolveShape, ResolveReturnShape> { tracing?: TracingFieldOptions<Types, ParentShape, InputShapeFromFields<Args>>; } } } //# sourceMappingURL=global-types.d.ts.map