Package graphql.execution.values
Interface InputInterceptor
-
- All Known Implementing Classes:
LegacyCoercingInputInterceptor
public interface InputInterceptor
This INTERNAL class can be used to intercept input values before they are coerced into runtime values by theValuesResolver
code.You could use it to observe input values and optionally change them. Perhaps some sort of migration of data needs to happen, and you need to know what data you are getting in type terms. This would help you do that.
If this is present in a
GraphQLContext
it will be called. By default, it is not present so no calls to it will be made.There is a performance aspect to using this code. If you take too long to return values then you are going to slow down your system depending on how big your input objects are.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
intercept(@Nullable java.lang.Object value, @NonNull GraphQLInputType graphQLType, @NonNull GraphQLContext graphqlContext, @NonNull java.util.Locale locale)
This is called with a value that is to be presented to theValuesResolver
code.
-
-
-
Method Detail
-
intercept
java.lang.Object intercept(@Nullable java.lang.Object value, @NonNull GraphQLInputType graphQLType, @NonNull GraphQLContext graphqlContext, @NonNull java.util.Locale locale)
This is called with a value that is to be presented to theValuesResolver
code. The values may be scalars, enums and complex input types.- Parameters:
value
- the input value that can be nullgraphQLType
- the input typegraphqlContext
- the graphql context in playlocale
- the locale in play- Returns:
- a value that may differ from the original value
-
-