Package graphql.execution
Class NonNullableFieldValidator
java.lang.Object
graphql.execution.NonNullableFieldValidator
This will check that a value is non-null when the type definition says it must be and, it will throw
NonNullableFieldWasNullException
if this is not the case.
See: http://spec.graphql.org/October2021/#sec-Errors-and-Non-Nullability-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
validate
(ExecutionStrategyParameters parameters, T result) Called to check that a value is non-null if the type requires it to be non null
-
Constructor Details
-
NonNullableFieldValidator
-
-
Method Details
-
validate
public <T> T validate(ExecutionStrategyParameters parameters, T result) throws NonNullableFieldWasNullException Called to check that a value is non-null if the type requires it to be non null- Type Parameters:
T
- the type of the result- Parameters:
parameters
- the execution strategy parametersresult
- the result to check- Returns:
- the result back
- Throws:
NonNullableFieldWasNullException
- if the value is null but the type requires it to be non null
-