Versions in this module Expand all Collapse all v0 v0.1.0 Nov 20, 2023 Changes in this version + type GraphqlUsage struct + ExtraValues map[string]interface{} + OperationMilliseconds int64 + OperationTime time.Time + Query string + QueryComplexity extension.ComplexityStats + QueryOperationName string + QueryVariables map[string]interface{} + ReferencedTypes map[string][]*ReferenceType + type GraphqlUsageRecorder struct + func New(options ...UsageRecorderOption) *GraphqlUsageRecorder + func (g *GraphqlUsageRecorder) CollectGraphqlUsage(ctx context.Context, oc *graphql.OperationContext) *GraphqlUsage + func (g *GraphqlUsageRecorder) ExtensionName() string + func (g *GraphqlUsageRecorder) GetUserAgent(oc *graphql.OperationContext) string + func (g *GraphqlUsageRecorder) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response + func (g *GraphqlUsageRecorder) Validate(schema graphql.ExecutableSchema) error + type LogEmitter struct + Logger *slog.Logger + RandomValueGenerator func() int + SamplingRate int + func NewLogEmitter(logger *slog.Logger, samplingRate int) *LogEmitter + func (x *LogEmitter) Emit(usage *GraphqlUsage) error + func (x *LogEmitter) Sampling() bool + type ReferenceType struct + Fields []string + TypeName string + type UsageEmitter interface + Emit func(usage *GraphqlUsage) error + type UsageRecorderOption func(*GraphqlUsageRecorder) + func WithClock(clock func() time.Time) UsageRecorderOption + func WithEmitVariables(emitVariables bool) UsageRecorderOption + func WithEmitter(emitter UsageEmitter) UsageRecorderOption + func WithEmitterErrorHandler(handler func(err error)) UsageRecorderOption + func WithExternalValuesExtractor(...) UsageRecorderOption + func WithLogger(logger *slog.Logger) UsageRecorderOption