Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/execution/values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ export function getArgumentValues(
variableValues?: Maybe<VariableValues>,
fragmentVariableValues?: Maybe<FragmentVariableValues>,
hideSuggestions?: Maybe<boolean>,
): { [argument: string]: unknown } {
const coercedValues: { [argument: string]: unknown } = {};
): ObjMap<unknown> {
const coercedValues: ObjMap<unknown> = Object.create(null);

const argumentNodes = node.arguments ?? [];
const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));
Expand Down
5 changes: 3 additions & 2 deletions src/utilities/coerceInputValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { invariant } from '../jsutils/invariant.js';
import { isIterableObject } from '../jsutils/isIterableObject.js';
import { isObjectLike } from '../jsutils/isObjectLike.js';
import type { Maybe } from '../jsutils/Maybe.js';
import type { ObjMap } from '../jsutils/ObjMap.js';

import type { ValueNode, VariableNode } from '../language/ast.js';
import { Kind } from '../language/kinds.js';
Expand Down Expand Up @@ -69,7 +70,7 @@ export function coerceInputValue(
return; // Invalid: intentionally return no value.
}

const coercedValue: any = {};
const coercedValue: ObjMap<unknown> = Object.create(null);
const fieldDefs = type.getFields();
const hasUndefinedField = Object.keys(inputValue).some(
(name) => !Object.hasOwn(fieldDefs, name),
Expand Down Expand Up @@ -211,7 +212,7 @@ export function coerceInputLiteral(
return; // Invalid: intentionally return no value.
}

const coercedValue: { [field: string]: unknown } = {};
const coercedValue: ObjMap<unknown> = Object.create(null);
const fieldDefs = type.getFields();
const hasUndefinedField = valueNode.fields.some(
(field) => !Object.hasOwn(fieldDefs, field.name.value),
Expand Down
Loading