Closed draxx318 closed 3 years ago
Yes. Just return an empty array.
For example, I have this in my project:
stories.add("Boat selector with no boat", () => (
<ApolloMockedProvider
customResolvers={{
Query: () => ({
me: () => ({
boats: [],
}),
}),
}}
>
<ControlledBoatSelectorInput />
</ApolloMockedProvider>
))
If this does not work for you, please send more details.
Thanks, works like a charm. I was trying to do it the same way but probably had something wrong with the implementation.
Is possible to pass a custom resolver with no data to the ApolloMockedProvider to simulate a scenario where the query returns an empty array?