Proposal for an additional instrumentation hook point by tinnou · Pull Request #4206 · graphql-java/graphql-java · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions src/main/java/graphql/execution/ExecutionStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import graphql.Internal;
import graphql.PublicSpi;
import graphql.execution.DataFetcherResult;
import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
Expand All @@ -26,6 +27,15 @@ public interface FieldFetchingInstrumentationContext extends InstrumentationCont
default void onFetchedValue(Object fetchedValue) {
}

/**
* This is called back after any {@link graphql.execution.DataFetcherExceptionHandler}) has run on any exception raised
* during a {@link graphql.schema.DataFetcher} invocation. This allows to see the final {@link DataFetcherResult}
* that will be used when performing the complete step.
* @param dataFetcherResult the final {@link DataFetcherResult} after the exception handler has run
*/
default void onExceptionHandled(DataFetcherResult<Object> dataFetcherResult) {
}

@Internal
FieldFetchingInstrumentationContext NOOP = new FieldFetchingInstrumentationContext() {
@Override
Expand Down
Loading