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

comparator missing for find by id

jchris opened this issue · comments

I am using a reduce-toolkit example app and getting errors. I am trying to update a Post in the mutations example app but get this error:

TypeError: comparatorFn is not a function
    at http://localhost:3000/static/js/bundle.js:32276:16
    at Array.reduce (<anonymous>)
    at http://localhost:3000/static/js/bundle.js:32245:41
    at Array.map (<anonymous>)
    at http://localhost:3000/static/js/bundle.js:32235:40
    at http://localhost:3000/static/js/bundle.js:32342:12
    at http://localhost:3000/static/js/bundle.js:32719:9
    at forEach (http://localhost:3000/static/js/bundle.js:32701:7)
    at Object.filter (http://localhost:3000/static/js/bundle.js:32718:3)
    at queryByPrimaryKey (http://localhost:3000/static/js/bundle.js:32340:24)

I think this is a problem with the data package, but the code to reproduce it is here.

here is a screenshot indicating the comparatorName is "0"

Screen Shot 2023-02-26 at 10 38 40 AM

Hope this helps someone fixing a similar issue!