Open cannikin opened 4 years ago
I have the same error when I call a cell with a QUERY
by id
like
device(id: $id) {
id
}
with a .stories.js file like
export const generated = () => {
return <AppointmentPage id="8b9abbf5-bf94-4486-a32a-533de2235e6c" />
}
I'm not sure if is related, but seem like the real error is swallowed the same!
I've been thinking about this, and I think we could wrap the withCell
hook in a custom error boundary (during development) that provides a way better error experience.
@peterp should we put this in the queue for a future Sprint? Or do you want to sit on it for a bit more?
I think we should add it to the queue - it would make dev/ testing/ storybook so much nicer.
While I don't see this issue happening anymore, the idea of wrapping a Cell in a dev-friendlier error boundary is still worthwhile, so I'll leave this issue open but remove it's bug/v1 status.
If you have a
QUERY
in a cell like:But in the associated story mock, the return data is missing one or more fields:
(
createdAt
is missing) you'll get a weird error in the story thatdata
is missing completely:This literal error is coming from
withCell
(which is thrown whendata
is indeed null) but it appears that something we're doing somewhere is swallowing the real error and we're left with this.