yarn msw 0.20.2

latest releases: 2.3.0, 2.2.14, 2.3.0-ws.rc-6...
3 years ago

Features

  • Adds graphql.link request handler that allows to mock GraphQL operations on per-endpoint basis (#315, #319).
import { setupWorker, graphql } from 'msw'

const github = graphql.link('https://api.github.com/graphql')
const stripe = graphql.link('https://api.stripe.com/graphql')

const worker = setupWorker(
  github.query('GetUser', resolver),
  stripe.mutation('Payment', resolver),
)

worker.start()

Bug fixes

  • Fixes a TypeScript issue that resulted into the following error (#321, #322):
ERROR in node_modules/msw/lib/types/context/cookie.d.ts:1:8 - error TS1192:
Module '"/node_modules/@types/cookie/index"' has no default export.

Don't miss a new msw release

NewReleases is sending notifications on new releases.