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

graphql.analysis.FieldComplexityCalculator Maven / Gradle / Ivy

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

import graphql.PublicApi;

/**
 * Used to calculate the complexity of a field. Used by {@link MaxQueryComplexityInstrumentation}.
 */
@PublicApi
@FunctionalInterface
public interface FieldComplexityCalculator {

    /**
     * Calculates the complexity of a field
     *
     * @param environment     several information about the current field
     * @param childComplexity the sum of all child complexity scores
     *
     * @return the calculated complexity
     */
    int calculate(FieldComplexityEnvironment environment, int childComplexity);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy