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

graphql.schema.DataFetcherFactories Maven / Gradle / Ivy

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

import graphql.PublicApi;

/**
 * A helper for {@link graphql.schema.DataFetcherFactory}
 */
@PublicApi
public class DataFetcherFactories {

    /**
     * Creates a {@link graphql.schema.DataFetcherFactory} that always returns the provided {@link graphql.schema.DataFetcher}
     *
     * @param dataFetcher the data fetcher to always return
     * @param          the type of the data fetcher
     *
     * @return a data fetcher factory that always returns the provided data fetcher
     */
    public static  DataFetcherFactory useDataFetcher(DataFetcher dataFetcher) {
        return fieldDefinition -> dataFetcher;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy