Introducing Network Handlers
GraphQL is network-agnostic and works across any protocol where requests and responses can be sent and received. This flexibility extends to graphql-mocks
allowing for writing mocks once and reusing them in node.js, the browser, and with any library that can handle requests and responses.
Depending on the situation different network handling will be appropriate for your mocking use-case. To make things easier graphql-mocks
provides packages to integrate with different network scenarios. These packages start with the network
prefix (ie: @graphql-mocks/network-*
).
More Network Handlers coming soon!
localhost
Network Handlers
gqlmocks
cli
gqlmocks serve
command- Documentation
Express
@graphql-mocks/network-express
- Documentation
Browser Network Handlers
msw
(mock service worker)
@graphql-mocks/network-msw
- Documentation
Pretender
@graphql-mocks/network-pretender
- Documentation
Cypress
@graphql-mocks/network-cypress
- Documentation
Playwright
@graphql-mocks/network-playwright
- Documentation
Node Network Handlers
Express
@graphql-mocks/network-express
- Documentation
Nock
@graphql-mocks/network-nock
- Documentation