data
data copied to clipboard
Data modeling and relation library for testing JavaScript applications.
- Closes #99
## GitHub - Closes #49 ## Changes - Database operations (create/update/delete/etc.) are not persisted in the `sessionStorage` and hydrated on page load. ## Roadmap - [ ] Write the `.toJson()`...
Any chance of having support for polymorphic relations? Like: ```javascript export const db = factory({ comment: { // ... commentable: oneOf('commentable', { polymorphic: true }) }, post: { // ......
## Problem Whenever I update an entity that is related to another through MSW, the other entity is not updated. This only happens when done through MSW. If I were...
I just noticed that over in #96 while adding tests. If I were to add a second model "Post" with a `oneOf` relationship "author" to "User", that would still be...
An `upsert` method updates an entity matching a query or creates a new entity if there was none. `upsertMany` behaves the same with the difference that it operates on multiple...
In order to use this library for SSR scenarios, there should be a way to synchronize the DB state on the server based on the operations performed on the client....
## Expected behavior The `snapshot` utility would memorize the state of the database (its entities) at a call time, and allow to restore to that memorized state at any further...
```js import { factory, seed } from '@mswjs/data' const db = factory(modles) seed(db, { [modelName]: seedOptions }) ```
Hi, I wanted to take a crack at this issue here: https://github.com/mswjs/data/issues/89 I've made a very basic POC that just adds the ability to do an OR query on the...