Skip to content
Merged
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/type/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ function createInputObjectDefaultValueCircularRefsValidator(
): void {
// Start with an empty object as a way to visit every field in this input
// object type and apply every default value.
return detectValueDefaultValueCycle(inputObj, {});
return detectValueDefaultValueCycle(inputObj, Object.create(null));
};

function detectValueDefaultValueCycle(
Expand Down Expand Up @@ -910,7 +910,7 @@ function createInputObjectDefaultValueCircularRefsValidator(

// Check to see if there is cycle.
const cycleIndex = fieldPathIndex[fieldStr];
if (cycleIndex !== undefined && cycleIndex > 0) {
if (cycleIndex !== undefined) {
context.reportError(
`Invalid circular reference. The default value of Input Object field ${fieldStr} references itself${
cycleIndex < fieldPath.length
Expand Down
Loading