public class ResponseField extends Object
ResponseField.Type class.| Modifier and Type | Class and Description |
|---|---|
static class |
ResponseField.BooleanCondition
Abstraction for boolean condition
|
static class |
ResponseField.Condition
Abstraction for condition to be associated with field
|
static class |
ResponseField.CustomTypeField
Abstraction for a Field representing a custom GraphQL scalar type.
|
static class |
ResponseField.Type
An abstraction for the field types
|
static class |
ResponseField.TypeNameCondition
Abstraction for type name condition
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
arguments() |
String |
cacheKey(Operation.Variables variables) |
List<ResponseField.Condition> |
conditions() |
String |
fieldName() |
static ResponseField |
forBoolean(String responseName,
String fieldName,
Map<String,Object> arguments,
boolean optional,
List<ResponseField.Condition> conditions)
Factory method for creating a Field instance representing
ResponseField.Type.BOOLEAN. |
static ResponseField.CustomTypeField |
forCustomType(String responseName,
String fieldName,
Map<String,Object> arguments,
boolean optional,
ScalarType scalarType,
List<ResponseField.Condition> conditions)
Factory method for creating a Field instance representing a custom GraphQL Scalar type,
ResponseField.Type.CUSTOM |
static ResponseField |
forDouble(String responseName,
String fieldName,
Map<String,Object> arguments,
boolean optional,
List<ResponseField.Condition> conditions)
Factory method for creating a Field instance representing
ResponseField.Type.DOUBLE. |
static ResponseField |
forEnum(String responseName,
String fieldName,
Map<String,Object> arguments,
boolean optional,
List<ResponseField.Condition> conditions)
Factory method for creating a Field instance representing
ResponseField.Type.ENUM. |
static ResponseField |
forFragment(String responseName,
String fieldName,
List<String> typeConditions)
Factory method for creating a Field instance representing
ResponseField.Type.FRAGMENT. |
static ResponseField |
forInlineFragment(String responseName,
String fieldName,
List<String> typeConditions)
Factory method for creating a Field instance representing
ResponseField.Type.INLINE_FRAGMENT. |
static ResponseField |
forInt(String responseName,
String fieldName,
Map<String,Object> arguments,
boolean optional,
List<ResponseField.Condition> conditions)
Factory method for creating a Field instance representing
ResponseField.Type.INT. |
static ResponseField |
forList(String responseName,
String fieldName,
Map<String,Object> arguments,
boolean optional,
List<ResponseField.Condition> conditions)
Factory method for creating a Field instance representing
ResponseField.Type.LIST. |
static ResponseField |
forLong(String responseName,
String fieldName,
Map<String,Object> arguments,
boolean optional,
List<ResponseField.Condition> conditions)
Factory method for creating a Field instance representing
ResponseField.Type.LONG. |
static ResponseField |
forObject(String responseName,
String fieldName,
Map<String,Object> arguments,
boolean optional,
List<ResponseField.Condition> conditions)
Factory method for creating a Field instance representing a custom
ResponseField.Type.OBJECT. |
static ResponseField |
forString(String responseName,
String fieldName,
Map<String,Object> arguments,
boolean optional,
List<ResponseField.Condition> conditions)
Factory method for creating a Field instance representing
ResponseField.Type.STRING. |
boolean |
optional() |
Object |
resolveArgument(String name,
Operation.Variables variables)
Resolve field argument value by name.
|
String |
responseName() |
ResponseField.Type |
type() |
public static ResponseField forString(String responseName, String fieldName, Map<String,Object> arguments, boolean optional, List<ResponseField.Condition> conditions)
ResponseField.Type.STRING.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationarguments - arguments to be passed along with the fieldoptional - whether the arguments passed along are optional or requiredconditions - list of conditions for this fieldResponseField.Type.STRINGpublic static ResponseField forInt(String responseName, String fieldName, Map<String,Object> arguments, boolean optional, List<ResponseField.Condition> conditions)
ResponseField.Type.INT.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationarguments - arguments to be passed along with the fieldoptional - whether the arguments passed along are optional or requiredconditions - list of conditions for this fieldResponseField.Type.INTpublic static ResponseField forLong(String responseName, String fieldName, Map<String,Object> arguments, boolean optional, List<ResponseField.Condition> conditions)
ResponseField.Type.LONG.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationarguments - arguments to be passed along with the fieldoptional - whether the arguments passed along are optional or requiredconditions - list of conditions for this fieldResponseField.Type.LONGpublic static ResponseField forDouble(String responseName, String fieldName, Map<String,Object> arguments, boolean optional, List<ResponseField.Condition> conditions)
ResponseField.Type.DOUBLE.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationarguments - arguments to be passed along with the fieldoptional - whether the arguments passed along are optional or requiredconditions - list of conditions for this fieldResponseField.Type.DOUBLEpublic static ResponseField forBoolean(String responseName, String fieldName, Map<String,Object> arguments, boolean optional, List<ResponseField.Condition> conditions)
ResponseField.Type.BOOLEAN.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationarguments - arguments to be passed along with the fieldoptional - whether the arguments passed along are optional or requiredconditions - list of conditions for this fieldResponseField.Type.BOOLEANpublic static ResponseField forEnum(String responseName, String fieldName, Map<String,Object> arguments, boolean optional, List<ResponseField.Condition> conditions)
ResponseField.Type.ENUM.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationarguments - arguments to be passed along with the fieldoptional - whether the arguments passed along are optional or requiredconditions - list of conditions for this fieldResponseField.Type.ENUMpublic static ResponseField forObject(String responseName, String fieldName, Map<String,Object> arguments, boolean optional, List<ResponseField.Condition> conditions)
ResponseField.Type.OBJECT.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationarguments - arguments to be passed along with the fieldoptional - whether the arguments passed along are optional or requiredconditions - list of conditions for this fieldResponseField.Type.OBJECTpublic static ResponseField forList(String responseName, String fieldName, Map<String,Object> arguments, boolean optional, List<ResponseField.Condition> conditions)
ResponseField.Type.LIST.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationarguments - arguments to be passed along with the fieldoptional - whether the arguments passed along are optional or requiredconditions - list of conditions for this fieldResponseField.Type.LISTpublic static ResponseField.CustomTypeField forCustomType(String responseName, String fieldName, Map<String,Object> arguments, boolean optional, ScalarType scalarType, List<ResponseField.Condition> conditions)
ResponseField.Type.CUSTOMresponseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationarguments - arguments to be passed along with the fieldoptional - whether the arguments passed along are optional or requiredscalarType - the custom scalar type of the fieldconditions - list of conditions for this fieldResponseField.Type.CUSTOMpublic static ResponseField forFragment(String responseName, String fieldName, List<String> typeConditions)
ResponseField.Type.FRAGMENT.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationtypeConditions - conditional GraphQL typesResponseField.Type.FRAGMENTpublic static ResponseField forInlineFragment(String responseName, String fieldName, List<String> typeConditions)
ResponseField.Type.INLINE_FRAGMENT.responseName - alias for the result of a fieldfieldName - name of the field in the GraphQL operationtypeConditions - conditional GraphQL typesResponseField.Type.INLINE_FRAGMENTpublic ResponseField.Type type()
public String responseName()
public String fieldName()
public boolean optional()
public List<ResponseField.Condition> conditions()
public String cacheKey(Operation.Variables variables)
@Nullable public Object resolveArgument(@Nonnull String name, @Nonnull Operation.Variables variables)
name - argument namevariables - values of operation variablesCopyright © 2018. All rights reserved.