Skip to content

Accessing a non existand data from the mockStore complains about the wrong thing #2320

Open
@nemonemi

Description

@nemonemi

Describe the bug

Accessing a resource from the mockStore that doesn't exist doesn't handle the situation well. It complains about the DateTime not being defined, and not that the resource access attempt is invalid.

image

This is how I handle the resource detail:

  resourceDetail: (_, { id }, { mockStore }) => {
    // here I'd like to check if the resource exists and then return a handled error
    return mockStore.get('ResourceDetail', id);
  },

I assume I should protect the endpoint, but how can this be done with the mockStore?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions