Skip to content

Commit c81c719

Browse files
committed
expose VariableValues
breaking change, have to do it in v17 or would have to wait until v18
1 parent aa1371f commit c81c719

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/execution/__tests__/executor-test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,19 @@ describe('Execute: Handles basic execution tasks', () => {
240240
expect(resolvedInfo).to.deep.include({
241241
fieldNodes: [field],
242242
path: { prev: undefined, key: 'result', typename: 'Test' },
243-
variableValues: { var: 'abc' },
243+
variableValues: {
244+
sources: {
245+
var: {
246+
signature: {
247+
name: 'var',
248+
type: GraphQLString,
249+
defaultValue: undefined,
250+
},
251+
value: 'abc',
252+
},
253+
},
254+
coerced: { var: 'abc' },
255+
},
244256
});
245257
});
246258

src/execution/execute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ export function buildResolveInfo(
843843
),
844844
rootValue: exeContext.rootValue,
845845
operation: exeContext.operation,
846-
variableValues: exeContext.variableValues.coerced,
846+
variableValues: exeContext.variableValues,
847847
};
848848
}
849849

src/type/definition.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import type {
4040
import { Kind } from '../language/kinds.js';
4141
import { print } from '../language/printer.js';
4242

43+
import type { VariableValues } from '../execution/values.js';
44+
4345
import { valueFromASTUntyped } from '../utilities/valueFromASTUntyped.js';
4446

4547
import { assertEnumValueName, assertName } from './assertName.js';
@@ -897,7 +899,7 @@ export interface GraphQLResolveInfo {
897899
readonly fragments: ObjMap<FragmentDefinitionNode>;
898900
readonly rootValue: unknown;
899901
readonly operation: OperationDefinitionNode;
900-
readonly variableValues: { [variable: string]: unknown };
902+
readonly variableValues: VariableValues;
901903
}
902904

903905
/**

0 commit comments

Comments
 (0)