Package org.allGraphQLCases.demo.impl
Class PartialPreparedQueries
java.lang.Object
org.allGraphQLCases.demo.impl.PartialPreparedQueries
- All Implemented Interfaces:
PartialQueries
This class implements the way to call GraphQl partialQueries, where all partialQueries are prepared before
execution.
The advantages are:
The advantages are:
- Performance: this avoid to build an
ObjectResponsefor each response. ThisObjectResponseis useful, to help control at runtime if a field has been queried or not. It allows to throw an exception when your code tries to use a field that was not queried - Security: as all request have been prepared at startup, this make sure at startup that your partialQueries are valid.
- Author:
- etienne-sf
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaBreak(CEP_extends_CES test, String $if) allFieldCases(CINP_AllFieldCasesInput_CINS allFieldCasesInput, Boolean uppercase, String textToAppendToTheForname, long nbItemsWithId, Date date, OffsetDateTime dateTime, List<Date> dates, Boolean uppercaseNameList, String textToAppendToTheNameWithId, CINP_FieldParameterInput_CINS input, int nbItemsWithoutId, CINP_FieldParameterInput_CINS inputList, String textToAppendToTheNameWithoutId) createHuman(CINP_HumanInput_CINS human) voidinit()This constructor expects the URI of the GraphQL server.withEnum(CEP_Episode_CES episode) withList(String name, List<CINP_CharacterInput_CINS> friends) withOneMandatoryParam(CINP_CharacterInput_CINS character) withOneOptionalParam(CINP_CharacterInput_CINS character)
-
Constructor Details
-
PartialPreparedQueries
public PartialPreparedQueries()
-
-
Method Details
-
init
@PostConstruct public void init() throws com.graphql_java_generator.exception.GraphQLRequestPreparationExceptionThis constructor expects the URI of the GraphQL server. This constructor works only for http servers, not for https ones.
For example: https://my.server.com/graphql- Parameters:
graphqlEndpoint- the https URI for the GraphQL endpointsslContext-hostnameVerifier-- Throws:
com.graphql_java_generator.exception.GraphQLRequestPreparationException
-
withoutParameters
public List<CIP_Character_CIS> withoutParameters() throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException- Specified by:
withoutParametersin interfacePartialQueries- Throws:
com.graphql_java_generator.exception.GraphQLRequestExecutionExceptioncom.graphql_java_generator.exception.GraphQLRequestPreparationException
-
withOneOptionalParam
public CIP_Character_CIS withOneOptionalParam(CINP_CharacterInput_CINS character) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException - Specified by:
withOneOptionalParamin interfacePartialQueries- Throws:
com.graphql_java_generator.exception.GraphQLRequestExecutionExceptioncom.graphql_java_generator.exception.GraphQLRequestPreparationException
-
withOneMandatoryParam
public CIP_Character_CIS withOneMandatoryParam(CINP_CharacterInput_CINS character) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException - Specified by:
withOneMandatoryParamin interfacePartialQueries- Throws:
com.graphql_java_generator.exception.GraphQLRequestExecutionExceptioncom.graphql_java_generator.exception.GraphQLRequestPreparationException
-
withEnum
public CIP_Character_CIS withEnum(CEP_Episode_CES episode) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException - Specified by:
withEnumin interfacePartialQueries- Throws:
com.graphql_java_generator.exception.GraphQLRequestExecutionExceptioncom.graphql_java_generator.exception.GraphQLRequestPreparationException
-
withList
public List<CIP_Character_CIS> withList(String name, List<CINP_CharacterInput_CINS> friends) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException - Specified by:
withListin interfacePartialQueries- Throws:
com.graphql_java_generator.exception.GraphQLRequestExecutionExceptioncom.graphql_java_generator.exception.GraphQLRequestPreparationException
-
error
public CIP_Character_CIS error(String errorLabel) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException - Specified by:
errorin interfacePartialQueries- Throws:
com.graphql_java_generator.exception.GraphQLRequestExecutionExceptioncom.graphql_java_generator.exception.GraphQLRequestPreparationException
-
allFieldCases
public CTP_AllFieldCases_CTS allFieldCases(CINP_AllFieldCasesInput_CINS allFieldCasesInput, Boolean uppercase, String textToAppendToTheForname, long nbItemsWithId, Date date, OffsetDateTime dateTime, List<Date> dates, Boolean uppercaseNameList, String textToAppendToTheNameWithId, CINP_FieldParameterInput_CINS input, int nbItemsWithoutId, CINP_FieldParameterInput_CINS inputList, String textToAppendToTheNameWithoutId) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException - Specified by:
allFieldCasesin interfacePartialQueries- Throws:
com.graphql_java_generator.exception.GraphQLRequestExecutionExceptioncom.graphql_java_generator.exception.GraphQLRequestPreparationException
-
aBreak
public CTP_break_CTS aBreak(CEP_extends_CES test, String $if) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException - Specified by:
aBreakin interfacePartialQueries- Throws:
com.graphql_java_generator.exception.GraphQLRequestExecutionExceptioncom.graphql_java_generator.exception.GraphQLRequestPreparationException
-
createHuman
public CTP_Human_CTS createHuman(CINP_HumanInput_CINS human) throws com.graphql_java_generator.exception.GraphQLRequestExecutionException, com.graphql_java_generator.exception.GraphQLRequestPreparationException - Specified by:
createHumanin interfacePartialQueries- Throws:
com.graphql_java_generator.exception.GraphQLRequestExecutionExceptioncom.graphql_java_generator.exception.GraphQLRequestPreparationException
-