VulcanJS / vulcan-next

The Next starter for GraphQL developers
http://vulcan-docs.vercel.app
MIT License
393 stars 29 forks source link

Use MSW for API mocking in tests #125

Open eric-burel opened 3 years ago

eric-burel commented 3 years ago

Is your feature request related to a problem? Please describe. Mocking graphql queries is annoying, and we use specific solution.

Describe the solution you'd like Use the same lib for all frontend request mocks.

Describe alternatives you've considered Apollo Mock Client: not bad. But MSW seems to become the standard for both Rest and graphql, because it catches calls at a lower level: https://mswjs.io/docs/getting-started/mocks/graphql-api

Additional context Testing with Next discussion: https://github.com/vercel/next.js/discussions/28173#discussioncomment-1281150

eric-burel commented 2 years ago

MSW also work for API:https://github.com/vercel/next.js/tree/canary/examples/with-msw

eric-burel commented 2 years ago

Done for Vulcan NPM, needs to be copied over Vulcan Next