You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If foo is not defined in a Stores schema, calling store.cache.query(q => q.findRecords('foo')) throws:
withQuery.tsx:35 Uncaught TypeError: Cannot read property 'values' of undefined
at findRecords (query-operators.js:18)
It looks like the problem is at line 40 of store/src/cache/query-operators.ts:
let results = Array.from(cache.records(expression.type).values());
cache.records returns undefined which makes .values() throw the above error, which isn't obvious what the problem is. Something like Store could not find 'foo' definition in cache. Did you forget to add it to your schema? would be more helpful. It looks like the other find operations all have a similar version of this.
I'm happy to throw together a PR with the check in place, but I wanted to get thoughts/feedback first.
The text was updated successfully, but these errors were encountered:
If
foo
is not defined in aStore
s schema, callingstore.cache.query(q => q.findRecords('foo'))
throws:It looks like the problem is at line 40 of
store/src/cache/query-operators.ts
:cache.records
returnsundefined
which makes.values()
throw the above error, which isn't obvious what the problem is. Something likeStore could not find 'foo' definition in cache. Did you forget to add it to your schema?
would be more helpful. It looks like the other find operations all have a similar version of this.I'm happy to throw together a PR with the check in place, but I wanted to get thoughts/feedback first.
The text was updated successfully, but these errors were encountered: