diff --git a/graphql/executor/executor.go b/graphql/executor/executor.go index d4f7ba7f786..b3163a4bd2e 100644 --- a/graphql/executor/executor.go +++ b/graphql/executor/executor.go @@ -37,24 +37,6 @@ func New(es graphql.ExecutableSchema) *Executor { return e } -// Exec returns a graphql response from the given params. -func (e *Executor) Exec(ctx context.Context, params *graphql.RawParams) *graphql.Response { - ctx = graphql.StartOperationTrace(ctx) - now := graphql.Now() - params.ReadTime = graphql.TraceTiming{ - Start: now, - End: now, - } - - rc, err := e.CreateOperationContext(ctx, params) - if err != nil { - return e.DispatchError(graphql.WithOperationContext(ctx, rc), err) - } - - resp, ctx2 := e.DispatchOperation(ctx, rc) - return resp(ctx2) -} - func (e *Executor) CreateOperationContext(ctx context.Context, params *graphql.RawParams) (*graphql.OperationContext, gqlerror.List) { rc := &graphql.OperationContext{ DisableIntrospection: true, diff --git a/graphql/executor/executor_test.go b/graphql/executor/executor_test.go index fc4207effbb..aec8d641e76 100644 --- a/graphql/executor/executor_test.go +++ b/graphql/executor/executor_test.go @@ -188,8 +188,16 @@ func TestErrorServer(t *testing.T) { } func query(exec *testexecutor.TestExecutor, op, q string) *graphql.Response { - return exec.Exec(context.Background(), &graphql.RawParams{ + ctx := context.Background() + rc, err := exec.CreateOperationContext(ctx, &graphql.RawParams{ Query: q, OperationName: op, }) + + if err != nil { + return exec.DispatchError(graphql.WithOperationContext(ctx, rc), err) + } + + resp, ctx2 := exec.DispatchOperation(ctx, rc) + return resp(ctx2) }