public DataFetcherExecutionPredicate
Perform runtime evaluations of each parameter passed to any FunctionDataFetcher.
The DataFetcherExecutionPredicate is declared globally for all the datafetchers instances and all the parameters.
However a more precise logic (at the field level) is possible depending on the implement of evaluate
Because the DataFetcherExecutionPredicate is global, it's not possible to have methods where the type is inferred.
It's recommended to check the type of the different arguments.
Modifier and Type | Method and Description |
---|---|
<T> T |
evaluate(T value,
kotlin.reflect.KParameter parameter,
graphql.schema.DataFetchingEnvironment environment)
Perform the predicate logic by evaluating the argument and its value.
Then depending on the result either:
|
<T> T evaluate(T value, kotlin.reflect.KParameter parameter, graphql.schema.DataFetchingEnvironment environment)
Perform the predicate logic by evaluating the argument and its value. Then depending on the result either:
Return the value itself to continue the datafetcher invocation
Throw an exception
value
- the value to evaluate the predicate againstparameter
- the function argument reference containing the KClass and the argument annotationsenvironment
- the DataFetchingEnvironment in which the data fetcher is executed (gives access to field info, execution context etc)