FeatureFuel
3

GraphQL query variable as input in Unit Test

Source: Kong/insomnia#4975 · opened by @eddex
Problem


Using a *design document*, I created a *query* and a *unit test* that runs tests on that query. The query has a *query variable* which is configured as part of the query in the "Debug" tab in Insomnia.

Query:



Query variables:



On the "Tests" tab I can create a unit test and select the "Test" query. Is it possible to pass in different query variables as the one configured in the "Debug" tab?

E.g. I want to run the unit test but instead of the query variable configured in the "Debig" tab, I want to pass in something like:



My current solution is to duplicate the query in the "Debug" tab for each unit test. While this works, it obviously creates a lot of duplication which makes adapting the tests to changes in the GraphQL schema a lot more labor intense than it could be.

Idea


It would be great if the query variables could be overridden in the unit test itself.

E.g. like this:

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests