graphql-query-test-mock
Advanced tools
Changelog
0.12.0
graphqlErrors
prop to query mock config, to support returning actual GraphQL errors, and not just server errors.Changelog
0.11.1
Changelog
0.10.3
Changelog
0.10.0
customHandler
can now be async and return a promise. This should simplify experimenting with automocking and other things needing async.Changelog
0.9.5
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).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
});