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

com.merapar.graphql.base.GraphQlFieldsHelper Maven / Gradle / Ivy

The newest version!
package com.merapar.graphql.base;

import graphql.schema.DataFetchingEnvironment;

import java.util.Collections;
import java.util.Map;

public class GraphQlFieldsHelper {
    public static String INPUT = "input";
    public static String FILTER = "filter";

    public static TypedValueMap getInputMap(DataFetchingEnvironment environment) {
        return new TypedValueMap(environment.getArgument(INPUT));
    }

    public static TypedValueMap getFilterMap(DataFetchingEnvironment environment) {
        Map filterMap = environment.getArgument(FILTER);

        if (filterMap == null) {
            return new TypedValueMap(Collections.emptyMap());
        }

        return new TypedValueMap(filterMap);
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy