Package graphql.execution
Class NonNullableFieldValidator
- java.lang.Object
-
- graphql.execution.NonNullableFieldValidator
-
public class NonNullableFieldValidator extends java.lang.ObjectThis will check that a value is non-null when the type definition says it must be and, it will throwNonNullableFieldWasNullExceptionif this is not the case. See: https://spec.graphql.org/October2021/#sec-Errors-and-Non-Nullability
-
-
Constructor Summary
Constructors Constructor Description NonNullableFieldValidator(ExecutionContext executionContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tvalidate(ExecutionStrategyParameters parameters, T result)Called to check that a value is non-null if the type requires it to be non null
-
-
-
Constructor Detail
-
NonNullableFieldValidator
public NonNullableFieldValidator(ExecutionContext executionContext)
-
-
Method Detail
-
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
-
-