99designs / 99designs/gqlgen

FieldStats appears to be unreferenced

Open
#1,667 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.8k
Forks
1.3k
Avg merge
2d 36m
Merged PRs (30d)
26

Description

### What happened?

I was adding instrumenting to a GraphQL server and found what looked to be a helpful struct: https://github.com/99designs/gqlgen/blob/5ad012e3d7be1127706b9c8a3da0378df3a98ec1/graphql/context_field.go#L35-L44

### What did you expect?

I expected to be able to access this from the FieldContext. For example:

```
fc := graphql.GetFieldContext(ctx)
durS := time.Since(fc.Stats.Started).Seconds()
```

`OperationContext` has similar abilities.

However, it doesn't appear that `FieldContext` is actually instantiated anywhere.

### Minimal graphql.schema and models to reproduce

### versions
- `gqlgen version`? v0.14.0
- `go version`? go version go1.17.1 linux/amd64
- dep or go modules? go modules

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.