Skip to content

Warn when a factory would lead to an infinite loop #59

@japboy

Description

@japboy

Let's say I have a GraphQL schema like below:

type ProductCategory {
  parent_category: ProductCategory
}

And this generates mock function like below:

export function createProductCategoryMock(props: Partial<ProductCategory> = {}): ProductCategory {
  return {
    parent_category: createProductCategoryMock({}),
    ...props,
  }
}

And this cause Maximum call stack size exceeded error. Do I just need to change the parent type different name? Any thoughts? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions