mock-inspect icon indicating copy to clipboard operation
mock-inspect copied to clipboard

Make graphQlQueryName __or__ graphQlMutationName relationship clear using typing

Open rickschubert opened this issue 3 years ago • 1 comments

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.

rickschubert avatar Apr 07 '21 16:04 rickschubert

cc @thomaschaplin

rickschubert avatar Apr 07 '21 16:04 rickschubert