Skip to content

Walk doesn't traverse with clauseΒ #216

@yilinjuang

Description

@yilinjuang

Since withClause has type WithClause and walk only handles Node type, the entire withClause is skipped.

{
name: 'withClause',
type: 'WithClause',
isArray: false,
optional: true
}

for (const field of nodeSpec.fields) {
if (field.type === 'Node' && nodeData[field.name] != null) {
const value = nodeData[field.name];
if (field.isArray && Array.isArray(value)) {
value.forEach((item, index) => {
walk(item, actualCallback, path, [...path.keyPath, field.name, index]);
});
} else if (!field.isArray) {
walk(value, actualCallback, path, [...path.keyPath, field.name]);
}
}
}

Same issue applies to union larg and rarg.

Expected behavior

Walk should traverse with clause and union.

Actual behavior

Walk skips with clause and union.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions