@envelop/apollo-tracing
Version:
This plugin tracks execution and resolvers and reports it using [`apollo-tracing`](https://github.com/apollographql/apollo-server/tree/main/packages/apollo-tracing) format (based on GraphQL `extensions`).
21 lines (20 loc) • 583 B
TypeScript
import { GraphQLType, ResponsePath } from 'graphql';
import { Plugin } from '@envelop/core';
interface ResolverCall {
path: ResponsePath;
fieldName: string;
parentType: GraphQLType;
returnType: GraphQLType;
startOffset: [number, number];
endOffset?: [number, number];
}
declare const apolloTracingSymbol: unique symbol;
type TracingContextObject = {
startTime: Date;
resolversTiming: ResolverCall[];
hrtime: [number, number];
};
export declare const useApolloTracing: () => Plugin<{
[apolloTracingSymbol]: TracingContextObject;
}>;
export {};