Comments (2)
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.
from apollo-mocked-provider.
Thanks, works like a charm. I was trying to do it the same way but probably had something wrong with the implementation.
from apollo-mocked-provider.
Related Issues (20)
- How to Clear Apollo Cache After Each Test? HOT 11
- Add option for globalMocks HOT 3
- Feature: Add path option for the fetchTypeDefs
- How to mock Types? HOT 4
- Changing path where updated typeDefs is located HOT 2
- Mock data from custom resolvers always overwritten by automatic mocks HOT 3
- Urgent: npm build missing dist folder HOT 1
- Add support for Apollo local state with client resolvers HOT 1
- Does the resolver function returns same data for multiple calls from same Query? HOT 3
- The automated release is failing 🚨
- Throwing an Error doesn't cause an Error to be thrown HOT 7
- npm link fails HOT 3
- Add `links` option to all create* functions
- Feature request: Different custom resolvers for same query HOT 1
- Error handling within MockedProvider HOT 7
- Mocked Provider errors on @apollo/client 3.3.7 latest HOT 1
- customResolvers for queries with aliases supported?
- signify which resolver corresponds to a specific query
- Changelog between v2 and v3 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-mocked-provider.