Skip to content

Commit

Permalink
graphql/executor_test: ensure operation trace is started before every…
Browse files Browse the repository at this point in the history
… query
  • Loading branch information
technoweenie committed Mar 4, 2020
1 parent 57dd8d9 commit f9bb017
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions graphql/executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,19 @@ func TestErrorServer(t *testing.T) {
}

func query(exec *testexecutor.TestExecutor, op, q string) *graphql.Response {
ctx := context.Background()
ctx := graphql.StartOperationTrace(context.Background())
now := graphql.Now()
rc, err := exec.CreateOperationContext(ctx, &graphql.RawParams{
Query: q,
OperationName: op,
ReadTime: graphql.TraceTiming{
Start: now,
End: now,
},
})

if err != nil {
return exec.DispatchError(graphql.WithOperationContext(ctx, rc), err)
return exec.DispatchError(ctx, err)
}

resp, ctx2 := exec.DispatchOperation(ctx, rc)
Expand Down

0 comments on commit f9bb017

Please sign in to comment.