Skip to content

Commit

Permalink
expose request to contextFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha authored and danielrearden committed Feb 27, 2021
1 parent b135e8e commit c0122ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/lib/process-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { stopAsyncIteration, isAsyncIterable, isHttpMethod } from "./util";
import { HttpError } from "./errors";
import {
ExecutionContext,
ExecutionPatchResult,
MultipartResponse,
ProcessRequestOptions,
Expand Down Expand Up @@ -143,7 +144,8 @@ export const processRequest = async <TContext = {}, TRootValue = {}>(
}

try {
const executionContext = {
const executionContext: ExecutionContext = {
request,
document,
operation,
variables: variableValues,
Expand Down
1 change: 1 addition & 0 deletions packages/core/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export interface FormatPayloadParams<TContext, TRootValue> {
}

export interface ExecutionContext {
request: Request;
document: DocumentNode;
operation: OperationDefinitionNode;
variables?: { readonly [name: string]: unknown };
Expand Down

0 comments on commit c0122ac

Please sign in to comment.