@graphql-yoga/plugin-apollo-inline-trace
Version:
Apollo's federated tracing plugin for GraphQL Yoga.
22 lines (21 loc) • 833 B
TypeScript
import { GraphQLError } from 'graphql';
import { Plugin, YogaInitialContext } from 'graphql-yoga';
export interface ApolloInlineTracePluginOptions {
/**
* Format errors before being sent for tracing. Beware that only the error
* `message` and `extensions` can be changed.
*
* Return `null` to skip reporting error.
*/
rewriteError?: (err: GraphQLError) => GraphQLError | null;
}
/**
* Produces Apollo's base64 trace protocol containing timing, resolution and
* errors information.
*
* The output is placed in `extensions.ftv1` of the GraphQL result.
*
* The Apollo Gateway utilizes this data to construct the full trace and submit
* it to Apollo's usage reporting ingress.
*/
export declare function useApolloInlineTrace(options?: ApolloInlineTracePluginOptions): Plugin<YogaInitialContext>;