I'm building a custom directive in which I'm hoping to validate entire input objects. I'm using the INPUT_OBJECT
type with the visitInputObject
method on SchemaDirectiveVisitor
extended class.
Every time I run a mutation using the input type then visitInputObject
does not run.
I've used the other types/methods like visitObject
and visitFieldDefinition
and they work perfectly. But when trying to use input types and methods they will not trigger.
I've read all the available documentation I can find. Is this just not supported yet?
Some context code(Not actual):
directive @validateThis on INPUT_OBJECT
input MyInputType @validateThis {
id: ID
someField: String
}
type Mutation {
someMutation(myInput: MyInputType!): SomeType
}
class ValidateThisDirective extends SchemaDirectiveVisitor {
visitInputObject(type) {
console.log('Not triggering');
}
}