All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.execution.instrumentation.ExecuteObjectInstrumentationContext Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
package graphql.execution.instrumentation;

import graphql.Internal;
import graphql.PublicSpi;
import graphql.execution.FieldValueInfo;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;

@PublicSpi
public interface ExecuteObjectInstrumentationContext extends InstrumentationContext> {

    @Internal
    ExecuteObjectInstrumentationContext NOOP = new ExecuteObjectInstrumentationContext() {
        @Override
        public void onDispatched() {
        }

        @Override
        public void onCompleted(Map result, Throwable t) {
        }
    };

    /**
     * This creates a no-op {@link InstrumentationContext} if the one pass in is null
     *
     * @param nullableContext a {@link InstrumentationContext} that can be null
     *
     * @return a non null {@link InstrumentationContext} that maybe a no-op
     */
    @NotNull
    @Internal
    static ExecuteObjectInstrumentationContext nonNullCtx(ExecuteObjectInstrumentationContext nullableContext) {
        return nullableContext == null ? NOOP : nullableContext;
    }

    default void onFieldValuesInfo(List fieldValueInfoList) {
    }

    default void onFieldValuesException() {
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy