Open june-cs opened 1 year ago
I've done GraphQL mocking. And I've done fetch() mocking in Storybook. But I haven't done GraphQL mocking in Storybook… yet.
Here's docs on mocking in GraphQL. https://graphql.org/blog/mocking-with-graphql/
You might be able to use those mock functions with fetch-mock, but I haven't tried it.
GraphQL only provides one endpoint unlike the REST type of API. Can you provide an example of how to mock several GraphQL requests for one component?
In other words, I have a React component that makes several requests to one Graphql endpoint, and the component receives a different set of data from each request.