Allow public access to the generated __{Operation}Input
variables
#358
Labels
enhancement
New feature or request
__{Operation}Input
variables
#358
Is your feature request related to a problem? Please describe.
I'd like to hook into the Marshal/UnMarshal methods on the
__{Operation}Input
struct definition to facilitate unit testing.We're using httpmock and making assertions on what is being sent in the body of the request and mocking the data to be returned.
Since the request is generated with custom json marshalers from genqlient, there doesn't seem to be a good way to test that the body of the request is as expected without either writing out a
[]byte{"json":"here"}
definition or creating a duplicate struct type that marshals similarly.Describe the solution you'd like
I'd like to add a configuration option to remove the prepended
__
in the code hereFor example, given something like this in
generated.go
I'd like to declare the following in a unit test
Describe alternatives you've considered
I tried using mockery and testing against the MakeRequest call, but it runs into the same issue with the private
__{Operation}Input
typeAdditional context
Looking in the example integration tests, it doesn't seem like the request variables are being inspected as noted here and in the test here with resolver here
The text was updated successfully, but these errors were encountered: