public class ObjectResponse extends Object
ObjectResponse itsled contains one or more ObjectResponse, to describe
the Sub-object(s) that should be returned.ObjectResponse can not be created directly. You must use an Builder to create a
ObjectResponse. This Builder allows to easily add fields, which can be scalars or sub-objects. And it
validates for each the GraphQL schema is respected.ObjectResponse:
ObjectResponse: a query ResponsDef is returned by the generated code. For instance, if your
schema contains a QueryType type, a QueryType object will be generated. For each query in the GraphQL schema, this
QueryType object contains two methods: a getter which returns the Builder for this query, and the method wich
actually do the call to the GraphQL server for this query.ObjectResponse: such a ObjectResponse allow you to define what's expected for a
field that is actually an object. This field is a sub-object of the object owning this field. To link such a
ObjectResponse, you'll use the Builder#withSubObject(String, ObjectResponse) or the
Builder#withSubObject(String, String, ObjectResponse) method.BuilderObjectResponse from the generated QueryType (or whatever name you have in your GraphQL
schema for the query object), and its method getXxxxResponseDef, where Xxxx is the name of the query into the
QueryType.Builder, you can call:
ObjectResponse. To get this
ObjectResponse, you'll create a Builder with one of the newSubObjectResponseDefBuilder methods.| Modifier and Type | Method and Description |
|---|---|
void |
addInputParameter(InputParameter inputParameter)
Add an
InputParameter to this object. |
void |
addInputParameters(List<InputParameter> inputParameters)
Add a list of
InputParameters to this object. |
void |
appendResponseQuery(StringBuilder sb,
Map<String,Object> parameters,
boolean appendSpaceParam)
Retrieves the part of the query, which describes the fields that the GraphQL server should return.
|
String |
getFieldAlias()
Retrieves the alias for the field, which response is defined by this instance
|
Class<?> |
getFieldClass()
Retrieves the class for the field, which response is defined by this instance
|
String |
getFieldName()
Retrieves the name for the field, which response is defined by this instance
|
List<InputParameter> |
getInputParameters()
Retrieves the
InputParameter for the field, which response is defined by this instance |
Class<?> |
getOwningClass()
Retrieves the GraphQL type that owns the field, which response is defined by this instance
|
public String getFieldAlias()
public Class<?> getOwningClass()
public Class<?> getFieldClass()
public String getFieldName()
public List<InputParameter> getInputParameters()
InputParameter for the field, which response is defined by this instancepublic void appendResponseQuery(StringBuilder sb, Map<String,Object> parameters, boolean appendSpaceParam) throws GraphQLRequestExecutionException
sb - The StringBuilder where the response must be appendedGraphQLRequestExecutionException - When there is an issue during execution, typically while managing the bind variables.public void addInputParameter(InputParameter inputParameter)
InputParameter to this object.inputParameter - public void addInputParameters(List<InputParameter> inputParameters)
InputParameters to this object.inputParameters - Copyright © 2020. All rights reserved.