Class Fragment
- java.lang.Object
-
- com.graphql_java_generator.client.request.Fragment
-
public class Fragment extends java.lang.Object- Author:
- etienne-sf
-
-
Constructor Summary
Constructors Constructor Description Fragment(QueryTokenizer qt, java.util.Map<java.lang.Class<?>,java.util.Map<java.lang.String,java.lang.reflect.Field>> aliasFields, java.lang.String packageName, boolean inlineFragment, java.lang.Class<?> clazz, java.lang.String schema)Reads a Fragment definition, from the currentQueryTokenizer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTypenameFields()Adds the __typename field into this fragment, and all the subojects it contains.voidappendToGraphQLRequests(java.lang.StringBuilder sb, java.util.Map<java.lang.String,java.lang.Object> params)java.lang.StringgetName()java.lang.StringgetTypeName()
-
-
-
Constructor Detail
-
Fragment
public Fragment(QueryTokenizer qt, java.util.Map<java.lang.Class<?>,java.util.Map<java.lang.String,java.lang.reflect.Field>> aliasFields, java.lang.String packageName, boolean inlineFragment, java.lang.Class<?> clazz, java.lang.String schema) throws GraphQLRequestPreparationException
Reads a Fragment definition, from the currentQueryTokenizer.- Parameters:
qt- TheQueryTokenizer, that just read the "fragment" keyword, or the "..." for inline fragmentaliasFields- This maps contains theField, that matches each alias, of each GraphQL type. This allows a proper deserialization of each alias value returned in the json responsepackageName- The package name is used to load the java class that has been generated for the given fragment's GraphQL typeinlineFragment- true if this fragment is an inline fragment. In this case, there is no fragment name to read.clazz- The owning class is mandatory for inlineFragment: if the "on Type" clause is not give, we need it to load the proper java class (that represents the proper GraphQL type)schema- value of the springBeanSuffix plugin parameter for the searched schema. When there is only one schema, this plugin parameter is usually not set. In this case, its default value ("") is used.- Throws:
GraphQLRequestPreparationException
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getTypeName
public java.lang.String getTypeName()
-
appendToGraphQLRequests
public void appendToGraphQLRequests(java.lang.StringBuilder sb, java.util.Map<java.lang.String,java.lang.Object> params) throws GraphQLRequestExecutionException- Throws:
GraphQLRequestExecutionException
-
addTypenameFields
public void addTypenameFields() throws GraphQLRequestPreparationExceptionAdds the __typename field into this fragment, and all the subojects it contains.
-
-