Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Make graphQlQueryName __or__ graphQlMutationName relationship clear using typing #22

Open
rickschubert opened this issue Apr 7, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@rickschubert
Copy link
Contributor

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 rickschubert added the enhancement New feature or request label Apr 7, 2021
@rickschubert
Copy link
Contributor Author

cc @thomaschaplin

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant