Skip to content

Best way to simulate offline mode while developing? #704

Answered by kettanaito
cmacdonnacha asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @cmacdonnacha.

You can simulate an offline mode using the res.networkError() utility.

rest.get('/user', (req, res, ctx) => {
  return res.networkError('Your error message')
})

Read more about res.networkError().

This produces an analogous response error as when requesting a resource while being offline.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@cmacdonnacha
Comment options

@kettanaito
Comment options

@cmacdonnacha
Comment options

@kettanaito
Comment options

@timdeschryver
Comment options

Answer selected by cmacdonnacha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants