@PublicApi public class SimpleFieldValidation extends java.lang.Object implements FieldValidation
addRule(ResultPath, java.util.function.BiFunction)
to supply the rule callbacks where
you implement your specific business logicConstructor and Description |
---|
SimpleFieldValidation() |
Modifier and Type | Method and Description |
---|---|
SimpleFieldValidation |
addRule(ResultPath fieldPath,
java.util.function.BiFunction<FieldAndArguments,FieldValidationEnvironment,java.util.Optional<GraphQLError>> rule)
Adds the rule against the field address path.
|
java.util.List<GraphQLError> |
validateFields(FieldValidationEnvironment validationEnvironment)
This is called to validate the fields and their arguments
|
public SimpleFieldValidation addRule(ResultPath fieldPath, java.util.function.BiFunction<FieldAndArguments,FieldValidationEnvironment,java.util.Optional<GraphQLError>> rule)
fieldPath
- the path to the fieldrule
- the rule functionpublic java.util.List<GraphQLError> validateFields(FieldValidationEnvironment validationEnvironment)
FieldValidation
validateFields
in interface FieldValidation
validationEnvironment
- the validation environment