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

graphql.schema.StaticDataFetcher Maven / Gradle / Ivy

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


import graphql.PublicApi;
import graphql.TrivialDataFetcher;

/**
 * A {@link graphql.schema.DataFetcher} that always returns the same value
 */
@PublicApi
public class StaticDataFetcher implements DataFetcher, TrivialDataFetcher {


    private final Object value;

    public StaticDataFetcher(Object value) {
        this.value = value;
    }

    @Override
    public Object get(DataFetchingEnvironment environment) {
        return value;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy