com.merapar.graphql.base.GraphQlFieldsHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot-starter-graphql Show documentation
Show all versions of spring-boot-starter-graphql Show documentation
This is a Spring boot starter project for the GraphQL Java project.
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);
}
}