@pothos/plugin-tracing
Version:
A Pothos plugin for tracing and logging resolver invocations
19 lines (18 loc) • 1.6 kB
TypeScript
import { type PothosOutputFieldConfig, type PothosOutputFieldType, type SchemaTypes } from '@pothos/core';
import { type GraphQLFieldResolver, type GraphQLResolveInfo } from 'graphql';
export declare function isRootField<Types extends SchemaTypes>(config: PothosOutputFieldConfig<Types>): boolean;
export declare function isScalarField<Types extends SchemaTypes>(config: PothosOutputFieldConfig<Types>): boolean;
export declare function isEnumField<Types extends SchemaTypes>(config: PothosOutputFieldConfig<Types>): boolean;
export declare function isExposedField<Types extends SchemaTypes>(config: PothosOutputFieldConfig<Types>): boolean;
export declare function resolveFieldType<Types extends SchemaTypes>(type: PothosOutputFieldType<Types>): "Enum" | "Interface" | "Object" | "Scalar" | "Union";
declare const spanCacheSymbol: unique symbol;
interface InternalContext<T> {
[spanCacheSymbol]?: Record<string, T>;
}
export declare function pathToString(info: GraphQLResolveInfo): string;
export declare function getParentSpan<T>(context: InternalContext<T>, info: GraphQLResolveInfo): NonNullable<T> | null;
export declare function createSpanWithParent<T>(context: object, info: GraphQLResolveInfo, createSpan: (path: string, parent: T | null) => T): T;
export declare function wrapResolver<C>(resolver: GraphQLFieldResolver<unknown, C, {}>, end: (error: unknown, duration: number) => void): GraphQLFieldResolver<unknown, C, {}>;
export declare function runFunction<T>(next: () => T, end: (error: unknown, duration: number) => void): unknown;
export {};
//# sourceMappingURL=util.d.ts.map