Hello,
We use the Apollo CLI to validate client operations against our deployed graph as described on this page.
We also structure our operations using variables for input params as described on this page.
We have found, however, that by structuring the operations this way, if the input param is a non-scalar type, the operations validation does not validate the fields of the passed in input variable. For example, suppose I have the following mutation operation that is consistent with my schema:
mutation MutateSomething($input: Something!) {
mutateSomething(input: $input) {
field1
field2
field3
}
}
And the input
variable we pass in looks like { field1: 'value1', field2: 'value2' }
.
Supposing Something
is defined like:
input Something {
field1: String!
field2: String!
field3: String!
}
Because field3
is required, the passed in input
variable that is missing it will fail. But because the client operation validation is made against the MutateSomething
operation, which doesn’t include the input
fields, it does not catch the failure. Is there a recommended way to account for such input variables when validating client operations?