@PublicSpi
public interface OnValidationErrorStrategy
RETURN_NULL is a common strategy to use, that is return null as the value for an invalid field
| Modifier and Type | Field and Description |
|---|---|
static OnValidationErrorStrategy |
RETURN_NULL
This strategy will prevent the current data fetch and return null as a value along with the errors
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
onErrorValue(java.util.List<graphql.GraphQLError> errors,
graphql.schema.DataFetchingEnvironment environment)
This will be called to generate a value that should be returned if we decide NOT to continue via
shouldContinue(java.util.List, graphql.schema.DataFetchingEnvironment). |
boolean |
shouldContinue(java.util.List<graphql.GraphQLError> errors,
graphql.schema.DataFetchingEnvironment environment)
This is called when there are validation errors present and it can decide whether to continue the current
data fetch (and hence return null) or whether it should in fact continue on anyway.
|
static final OnValidationErrorStrategy RETURN_NULL
boolean shouldContinue(java.util.List<graphql.GraphQLError> errors,
graphql.schema.DataFetchingEnvironment environment)
errors - the list errorsenvironment - the environment in playjava.lang.Object onErrorValue(java.util.List<graphql.GraphQLError> errors,
graphql.schema.DataFetchingEnvironment environment)
shouldContinue(java.util.List, graphql.schema.DataFetchingEnvironment).errors - the list errorsenvironment - the environment in play