Package com.shopify.graphql.support
Class AbstractQuery<T extends AbstractQuery>
- java.lang.Object
-
- com.shopify.graphql.support.AbstractQuery<T>
-
- Direct Known Subclasses:
__DirectiveQuery
,__EnumValueQuery
,__FieldQuery
,__InputValueQuery
,__SchemaQuery
,__TypeQuery
,_EnumValueQuery
,_FieldGroupQuery
,_FieldShapeQuery
,_GraphReportQuery
,_PathQuery
,_RDFNodeQuery
,_ResourceQuery
,_TestResultQuery
,_TypeShapeQuery
,_ValidationReportQuery
,_ValidationResultQuery
,_ValidationResultSuggestionQuery
,ConstraintReificationShapeQuery
,CustomFieldQuery
,GraphQuery
,GraphTypeQuery
,LiteralQuery
,MasterGraphQuery
,RootRDFQueryQuery
,UserQuery
,WorkflowGraphQuery
public abstract class AbstractQuery<T extends AbstractQuery> extends Object
Created by eapache on 2015-11-17.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringBuilder
_queryBuilder
static String
ALIAS_SUFFIX_SEPARATOR
static String
CUSTOM_FIELD_LABEL
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractQuery(StringBuilder queryBuilder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
addCustomObjectField(String fieldName, CustomFieldQueryDefinition queryDef)
Adds a custom object field to the GraphQL query.T
addCustomSimpleField(String fieldName)
Adds a custom simple field to the GraphQL query.static void
appendQuotedString(StringBuilder query, String string)
protected void
startField(String fieldName)
protected void
startInlineFragment(String typeName)
T
withAlias(String aliasSuffix)
-
-
-
Field Detail
-
ALIAS_SUFFIX_SEPARATOR
public static final String ALIAS_SUFFIX_SEPARATOR
- See Also:
- Constant Field Values
-
CUSTOM_FIELD_LABEL
public static final String CUSTOM_FIELD_LABEL
- See Also:
- Constant Field Values
-
_queryBuilder
protected final StringBuilder _queryBuilder
-
-
Constructor Detail
-
AbstractQuery
protected AbstractQuery(StringBuilder queryBuilder)
-
-
Method Detail
-
appendQuotedString
public static void appendQuotedString(StringBuilder query, String string)
-
startInlineFragment
protected void startInlineFragment(String typeName)
-
startField
protected void startField(String fieldName)
-
addCustomSimpleField
public T addCustomSimpleField(String fieldName)
Adds a custom simple field to the GraphQL query. The adjective "simple" here refers to a scalar/primitive field like String, Integer, Double, Boolean, or an array of fields.- Parameters:
fieldName
- The name of the field that will be added to the GraphQL request.- Returns:
- The current query builder.
-
addCustomObjectField
public T addCustomObjectField(String fieldName, CustomFieldQueryDefinition queryDef)
Adds a custom object field to the GraphQL query. The term "object" here refers to a GraphQL object, which means some fields of the custom object must also be defined in the query.- Parameters:
fieldName
- The name of the field that will be added to the GraphQL request.queryDef
- The definition of the requested sub-fields of the object.- Returns:
- The current query builder.
-
-