aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/99designs/gqlgen/graphql/tracer.go
blob: 0597ce8cc8a1889683ca85ebff6b363848af8f14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package graphql

import (
	"context"
)

var _ Tracer = (*NopTracer)(nil)

type Tracer interface {
	StartOperationParsing(ctx context.Context) context.Context
	EndOperationParsing(ctx context.Context)
	StartOperationValidation(ctx context.Context) context.Context
	EndOperationValidation(ctx context.Context)
	StartOperationExecution(ctx context.Context) context.Context
	StartFieldExecution(ctx context.Context, field CollectedField) context.Context
	StartFieldResolverExecution(ctx context.Context, rc *ResolverContext) context.Context
	StartFieldChildExecution(ctx context.Context) context.Context
	EndFieldExecution(ctx context.Context)
	EndOperationExecution(ctx context.Context)
}

type NopTracer struct{}

func (NopTracer) StartOperationParsing(ctx context.Context) context.Context {
	return ctx
}

func (NopTracer) EndOperationParsing(ctx context.Context) {
}

func (NopTracer) StartOperationValidation(ctx context.Context) context.Context {
	return ctx
}

func (NopTracer) EndOperationValidation(ctx context.Context) {
}

func (NopTracer) StartOperationExecution(ctx context.Context) context.Context {
	return ctx
}

func (NopTracer) StartFieldExecution(ctx context.Context, field CollectedField) context.Context {
	return ctx
}

func (NopTracer) StartFieldResolverExecution(ctx context.Context, rc *ResolverContext) context.Context {
	return ctx
}

func (NopTracer) StartFieldChildExecution(ctx context.Context) context.Context {
	return ctx
}

func (NopTracer) EndFieldExecution(ctx context.Context) {
}

func (NopTracer) EndOperationExecution(ctx context.Context) {
}