diff --git a/src/execution/__tests__/executor-test.ts b/src/execution/__tests__/executor-test.ts index 173dcc9483..232852b7a2 100644 --- a/src/execution/__tests__/executor-test.ts +++ b/src/execution/__tests__/executor-test.ts @@ -222,6 +222,7 @@ describe('Execute: Handles basic execution tasks', () => { 'rootValue', 'operation', 'variableValues', + 'variableValuesWithSources', ); const operation = document.definitions[0]; @@ -240,7 +241,8 @@ describe('Execute: Handles basic execution tasks', () => { expect(resolvedInfo).to.deep.include({ fieldNodes: [field], path: { prev: undefined, key: 'result', typename: 'Test' }, - variableValues: { + variableValues: { var: 'abc' }, + variableValuesWithSources: { sources: { var: { signature: { diff --git a/src/execution/execute.ts b/src/execution/execute.ts index 00f0e7b1ae..19fa5fb4ff 100644 --- a/src/execution/execute.ts +++ b/src/execution/execute.ts @@ -955,7 +955,8 @@ export function buildResolveInfo( fragments: fragmentDefinitions, rootValue, operation, - variableValues, + variableValues: variableValues.coerced, + variableValuesWithSources: variableValues, }; } diff --git a/src/type/definition.ts b/src/type/definition.ts index 8d51201070..2d5450deaf 100644 --- a/src/type/definition.ts +++ b/src/type/definition.ts @@ -1003,7 +1003,8 @@ export interface GraphQLResolveInfo { readonly fragments: ObjMap; readonly rootValue: unknown; readonly operation: OperationDefinitionNode; - readonly variableValues: VariableValues; + readonly variableValues: { [variable: string]: unknown }; + readonly variableValuesWithSources: VariableValues; } /**