Skip to content

v0.20.2

Compare
Choose a tag to compare
@kettanaito kettanaito released this 05 Aug 08:39

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.