mirror of
https://github.com/hanzoai/msw.git
synced 2026-09-24 17:00:34 +00:00
Co-authored-by: Frederik Rabøl <[email protected]> Co-authored-by: Christoph Fricke <[email protected]> Co-authored-by: Piotr <[email protected]> Co-authored-by: Kristján Oddsson <[email protected]> Co-authored-by: thepassle <[email protected]> Co-authored-by: Kevin Østerkilde <[email protected]> Co-authored-by: Laryssa Rocha <[email protected]> Co-authored-by: Matthew Costabile <[email protected]>
23 lines
414 B
TypeScript
23 lines
414 B
TypeScript
import { graphql, HttpResponse } from 'msw'
|
|
import { setupWorker } from 'msw/browser'
|
|
|
|
const worker = setupWorker(
|
|
graphql.query('Login', () => {
|
|
return HttpResponse.json({
|
|
errors: [
|
|
{
|
|
message: 'This is a mocked error',
|
|
locations: [
|
|
{
|
|
line: 1,
|
|
column: 2,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
})
|
|
}),
|
|
)
|
|
|
|
worker.start()
|