UNPKG

@graphql-mesh/transform-hive

Version:
20 lines (19 loc) 1.2 kB
import { type ExecutionResult, type GraphQLSchema } from 'graphql'; import { type HiveClient } from '@graphql-hive/core'; import type { MeshTransform, MeshTransformOptions, YamlConfig } from '@graphql-mesh/types'; import { type DelegationContext } from '@graphql-tools/delegate'; import { type ExecutionRequest } from '@graphql-tools/utils'; interface TransformationContext { collectUsageCallback?: ReturnType<HiveClient['collectUsage']>; request: ExecutionRequest; } export default class HiveTransform implements MeshTransform { private hiveClient; private logger; private schema; constructor({ config, logger }: MeshTransformOptions<YamlConfig.HivePlugin>); transformSchema(schema: GraphQLSchema): GraphQLSchema; transformRequest(request: ExecutionRequest, _delegationContext: DelegationContext, transformationContext: TransformationContext): ExecutionRequest<any, any, any, Record<string, any>, any>; transformResult(result: ExecutionResult, _delegationContext: DelegationContext, transformationContext: TransformationContext): ExecutionResult<import("graphql/jsutils/ObjMap").ObjMap<unknown>, import("graphql/jsutils/ObjMap").ObjMap<unknown>>; } export {};