Socket
Socket
Sign inDemoInstall

graphql-query-test-mock

Package Overview
Dependencies
58
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
2Next

0.12.1

Diff

Changelog

Source

0.12.1

  • Fix memory leak issue (thanks @msimulcik!).
_zth
published 0.12.0 •

Changelog

Source

0.12.0

  • Add graphqlErrors prop to query mock config, to support returning actual GraphQL errors, and not just server errors.
_zth
published 0.11.1 •

Changelog

Source

0.11.1

  • Fixes bug with operation names not properly picked up when fragments appear before the operation in the query, courtesy of @msimulcik.
_zth
published 0.11.0 •

Changelog

Source

0.11.0

  • Drop support for Node < 8.
_zth
published 0.10.3 •

Changelog

Source

0.10.3

  • Improved error messages for missing mocks.
  • Variables now match regardless of property order in variable objects.
_zth
published 0.10.2 •

Changelog

Source

0.10.2

  • Adds a method to clean up nock.
_zth
published 0.10.1 •

Changelog

Source

0.10.1

  • Updating TypeScript definitions.
_zth
published 0.10.0 •

Changelog

Source

0.10.0

  • customHandler can now be async and return a promise. This should simplify experimenting with automocking and other things needing async.
_zth
published 0.9.6 •

Changelog

Source

0.9.6

  • Bug fix from accidental mutation. Mutability is fun, but hard!
_zth
published 0.9.5 •

Changelog

Source

0.9.5

  • Added ignoreThesePropertiesInVariables: Array<string> to the mock config, which basically is a more convenient way of filtering out unstable variables you may use in your queries (like dates).
  • Support mocking the same query multiple times with different variables without needing to resort to re-mocking after a query mock has been used. This should be quite a bit more convenient, allowing you to do something like this:
queryMock.mockQuery({
  name: 'SomeQuery',
  variables: {
    first: true
  },
  data: firstData
});

queryMock.mockQuery({
  name: 'SomeQuery',
  variables: {
    second: true
  },
  data: secondData
});

...instead of like before:

queryMock.mockQuery({
  name: 'SomeQuery',
  variables: {
    first: true
  },
  data: firstData
});

/**
 * Your operation consuming the mock would have to be run and done before you could re-mock the query
 * to return your second response.
 */

someThingThatConsumesTheQueryAbove();

queryMock.mockQuery({
  name: 'SomeQuery',
  variables: {
    second: true
  },
  data: secondData
});
2Next
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc