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: https://spec.graphql.org/October2021/#sec-Errors-and-Non-Nullability-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNonNullableFieldValidator
(ExecutionContext executionContext, ExecutionStepInfo executionStepInfo) -
Method Summary
Modifier and TypeMethodDescription<T> T
validate
(ResultPath path, T result) Called to check that a value is non null if the type requires it to be non null
-
Field Details
-
executionContext
-
executionStepInfo
-
-
Constructor Details
-
NonNullableFieldValidator
public NonNullableFieldValidator(ExecutionContext executionContext, ExecutionStepInfo executionStepInfo)
-
-
Method Details
-
validate
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:
path
- the path to this placeresult
- the result to check- Returns:
- the result back
- Throws:
NonNullableFieldWasNullException
- if the value is null but the type requires it to be non null
-