public abstract class GQLDataFetcherUtils extends Object
| Constructor and Description |
|---|
GQLDataFetcherUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Object> |
convertObjectValue(graphql.language.ObjectValue objectValue,
Map<String,Object> arguments,
Collection<String> providedVariableNames)
Convert GQL object value to a
Map |
static Map<String,Object> |
getArgumentsForContext(Map<String,Object> arguments,
String argumentContext)
Get arguments with given property name within parent's arguments map
|
static List<Map<String,Object>> |
getArgumentsForContextAsList(Map<String,Object> arguments,
String argumentContext)
Get arguments with given property name within parent's arguments map as a
List |
static Object |
getArgumentValue(graphql.language.Field queryField,
String name,
Map<String,Object> arguments,
Collection<String> providedVariableNames)
Get argument by name within given query field
|
static String |
getEntityName(String prefix,
String queryName)
Get entity by name
|
static <T> T |
mapValue(graphql.language.Argument argument,
Map<String,Object> arguments,
Collection<String> providedVariableNames)
Map GQL argument value to an object
|
static <T> T |
mapValue(graphql.language.ObjectField field,
Map<String,Object> arguments,
Collection<String> providedVariableNames)
Map GQL object field value to an object
|
public static String getEntityName(String prefix, String queryName)
prefix - the entity prefixqueryName - the query namepublic static <T> T mapValue(graphql.language.ObjectField field,
Map<String,Object> arguments,
Collection<String> providedVariableNames)
T - the value typefield - the GQL ObjectFieldarguments - the map of query arguments for potential replacementsprovidedVariableNames - names of provided variables for the requestpublic static <T> T mapValue(graphql.language.Argument argument,
Map<String,Object> arguments,
Collection<String> providedVariableNames)
T - the value typeargument - the GQL Argumentarguments - the map of query arguments for potential replacementsprovidedVariableNames - names of provided variables for the requestpublic static Map<String,Object> getArgumentsForContext(Map<String,Object> arguments, String argumentContext)
arguments - the parent's arguments mapargumentContext - the argument context nameMap (may be empty)public static List<Map<String,Object>> getArgumentsForContextAsList(Map<String,Object> arguments, String argumentContext)
Listpublic static Map<String,Object> convertObjectValue(graphql.language.ObjectValue objectValue, Map<String,Object> arguments, Collection<String> providedVariableNames)
MapobjectValue - the ObjectValuearguments - the Map of argumentsprovidedVariableNames - names of provided variables for the requestpublic static Object getArgumentValue(graphql.language.Field queryField, String name, Map<String,Object> arguments, Collection<String> providedVariableNames)
queryField - the query Fieldname - then argument namearguments - the Map of argumentsprovidedVariableNames - names of provided variables for the requestCopyright © 2019. All rights reserved.