graphql-tools
graphql-tools copied to clipboard
Gain access to input variables from mock functions
Is your feature request related to a problem? Please describe.
During testing, I need to make sure certain requests are being called with specific variables, similar to how you'd assert functions were called with certain arguments.
Describe the solution you'd like Pass the input variables of the operation to the mocked function, only if it's a mock for an operation (mutation/query), not just any field.
Describe alternatives you've considered I tried using resolvers, which seem to be getting the input variables through the info parameter, but resolvers have to supply all the fields for a given operation, whereas I want to supply only partial fields and let the rest of the fields be populated using the current mocking strategy.
This used to work in [email protected]. After upgrading to 8.x, cannot check variables anymore from mock.calls.