mock-inspect
mock-inspect copied to clipboard
Make graphQlQueryName __or__ graphQlMutationName relationship clear using typing
When calling mockRequest
, users are not allowed to add graphQlQueryName AND graphQlMutationName at the same time. If the user does so, we will throw an error at runtime telling the user that the creation of this mock is incorrect.
The above behaviour is useful and I would leave it in. It makes a lot of sense for when developers create code without IDE hints. But I propose to add an additional way of warning the user: We could type the MockResponseOptions interface so that it will tell the user already at compile time/at time of writing code in their IDE (i.e. VSCode) that one can't define the two properties at the same time.
cc @thomaschaplin