The options you can use when traversing.

interface TraverseOptions {
    bfs?: boolean;
    mergeNotMutate?: boolean;
    mutable?: boolean;
    skipFirstMutation?: boolean;
}

Properties

bfs?: boolean

true if you want to traverse in a breadth-first manner. This will cause the mutation function to be called first with the root schema, moving down the subschemas until the terminal subschemas.

mergeNotMutate?: boolean

Set this to true if you want to merge the returned value of the mutation function into the original schema.

mutable?: boolean

true if you want the original schema that was provided to be directly modified by the provided mutation/merge function To preserve cyclical refs this is necessary.

skipFirstMutation?: boolean

Set this to true if you don't want to call the mutator function on the root schema.