mswjs / data

Data modeling and relation library for testing JavaScript applications.

Home Page:https://npm.im/@mswjs/data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to store plain JSON as an attribute

ericchernuka opened this issue · comments

Right now I have a data model that does not contain primary keys and is actually recursive. The backend actually stores the column a as JSON, but I'm currently having to build a model around it when it would be drastically simpler if I had the ability to have a dataType that was just a plain JSON object.

Example that I'm working with:

{
  type: "group",
  condition: "all",
  rules: [
    {
      type: "group",
      condition: "all",
      rules: [
        {
          type: "field",
          operator: "is",
          field: "a07eb0da-fe24-5dc8-93ef-511daa5a4fc7",
          value: "test"
        },
      ],
    },
  ],
}

All that being said, maybe there's an easier way to model this than what I'm thinking.

Looks like #165 may resolve my issues. 🤔

Hey, @ericchernuka. At the moment we don't support creation of static fixtures (data without primary keys). We've got the task opened #161 and will schedule it for the future.