Interface FieldFetchingInstrumentationContext
-
- All Superinterfaces:
InstrumentationContext<java.lang.Object>
@PublicSpi public interface FieldFetchingInstrumentationContext extends InstrumentationContext<java.lang.Object>
FieldFetchingInstrumentationContext is returned back from theInstrumentation.beginFieldFetching(InstrumentationFieldFetchParameters, InstrumentationState)method, and it's much like the normalInstrumentationContexttype except it also gives the value that was returned by a fieldsDataFetcher. This allows you to know if the field value is a completely materialised field or if it's aCompletableFuturepromise to a value.
-
-
Field Summary
Fields Modifier and Type Field Description static FieldFetchingInstrumentationContextNOOP
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static FieldFetchingInstrumentationContextadapter(@Nullable InstrumentationContext<java.lang.Object> context)static @NonNull FieldFetchingInstrumentationContextnonNullCtx(FieldFetchingInstrumentationContext nullableContext)This creates a no-opInstrumentationContextif the one passed in is nulldefault voidonFetchedValue(java.lang.Object fetchedValue)This is called back with the value fetched for the field by itsDataFetcher.-
Methods inherited from interface graphql.execution.instrumentation.InstrumentationContext
onCompleted, onDispatched
-
-
-
-
Field Detail
-
NOOP
static final FieldFetchingInstrumentationContext NOOP
-
-
Method Detail
-
onFetchedValue
default void onFetchedValue(java.lang.Object fetchedValue)
This is called back with the value fetched for the field by itsDataFetcher. This can be a materialised java object or it maybe aCompletableFuturepromise to some async value that has not yet completed.- Parameters:
fetchedValue- a value that a field'sDataFetcherreturned
-
nonNullCtx
static @NonNull FieldFetchingInstrumentationContext nonNullCtx(FieldFetchingInstrumentationContext nullableContext)
This creates a no-opInstrumentationContextif the one passed in is null- Parameters:
nullableContext- aInstrumentationContextthat can be null- Returns:
- a non-null
InstrumentationContextthat maybe a no-op
-
adapter
static FieldFetchingInstrumentationContext adapter(@Nullable InstrumentationContext<java.lang.Object> context)
-
-