Class QueryExecutorMySchema
java.lang.Object
com.graphql_java_generator.domain.client.forum.QueryExecutorMySchema
- All Implemented Interfaces:
GraphQLQueryExecutor
- Direct Known Subclasses:
Query
This class contains the methods that allows the execution of the queries or mutations that are defined in the Query
of the GraphQL schema.
These methods allows:
These methods allows:
- Preparation of full requests
- Execution of full prepared requests
- Execution of full direct requests
- Preparation of partial requests
- Execution of partial prepared requests
- Execution of partial direct requests
- Author:
- generated by graphql-java-generator
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription__schema
(ObjectResponse objectResponse, Object... paramsAndValues) This method is expected by the graphql-java framework.This method executes a partial query against the GraphQL server.__schemaWithBindValues
(ObjectResponse objectResponse, Map<String, Object> parameters) This method is expected by the graphql-java framework.__schemaWithBindValues
(String queryResponseDef, Map<String, Object> parameters) This method executes a partial query against the GraphQL server.__type
(ObjectResponse objectResponse, String name, Object... paramsAndValues) This method is expected by the graphql-java framework.This method executes a partial query against the GraphQL server.__typename
(ObjectResponse objectResponse, Object... paramsAndValues) This method is expected by the graphql-java framework.__typename
(String queryResponseDef, Object... paramsAndValues) This method executes a partial query against the GraphQL server.__typenameWithBindValues
(ObjectResponse objectResponse, Map<String, Object> parameters) This method is expected by the graphql-java framework.__typenameWithBindValues
(String queryResponseDef, Map<String, Object> parameters) This method executes a partial query against the GraphQL server.__typeWithBindValues
(ObjectResponse objectResponse, String name, Map<String, Object> parameters) This method is expected by the graphql-java framework.This method executes a partial query against the GraphQL server.boards
(ObjectResponse objectResponse, Object... paramsAndValues) This method is expected by the graphql-java framework.This method executes a partial query against the GraphQL server.boardsWithBindValues
(ObjectResponse objectResponse, Map<String, Object> parameters) This method is expected by the graphql-java framework.boardsWithBindValues
(String queryResponseDef, Map<String, Object> parameters) This method executes a partial query against the GraphQL server.exec
(ObjectResponse objectResponse, Object... paramsAndValues) This method takes a full request definition, and executes it against the GraphQL server.This method takes a full request definition, and executes it against the GraphQL server.execWithBindValues
(ObjectResponse objectResponse, Map<String, Object> parameters) This method takes a full request definition, and executes it against the GraphQL server.execWithBindValues
(String queryResponseDef, Map<String, Object> parameters) This method takes a full request definition, and executes the it against the GraphQL server.findTopics
(ObjectResponse objectResponse, String boardName, List<String> keyword, Object... paramsAndValues) This method is expected by the graphql-java framework.findTopics
(String queryResponseDef, String boardName, List<String> keyword, Object... paramsAndValues) This method executes a partial query against the GraphQL server.findTopicsWithBindValues
(ObjectResponse objectResponse, String boardName, List<String> keyword, Map<String, Object> parameters) This method is expected by the graphql-java framework.findTopicsWithBindValues
(String queryResponseDef, String boardName, List<String> keyword, Map<String, Object> parameters) This method executes a partial query against the GraphQL server.get__schemaGraphQLRequest
(String partialRequest) Get theGraphQLRequest
for the __schema executor, created with the given Partial request.Get theBuilder
for the __Schema, as expected by the __schema query.get__typeGraphQLRequest
(String partialRequest) Get theGraphQLRequest
for the __type executor, created with the given Partial request.get__typenameGraphQLRequest
(String partialRequest) Get theGraphQLRequest
for the __typename executor, created with the given Partial request.Get theBuilder
for the String, as expected by the __typename query.Get theBuilder
for the __Type, as expected by the __type query.getBoardsGraphQLRequest
(String partialRequest) Get theGraphQLRequest
for the boards executor, created with the given Partial request.Get theBuilder
for the Board, as expected by the boards query.getFindTopicsGraphQLRequest
(String partialRequest) Get theGraphQLRequest
for the findTopics executor, created with the given Partial request.Get theBuilder
for the Topic, as expected by the findTopics query.getGraphQLRequest
(String fullRequest) Get theGraphQLRequest
for full request.getNbBoardsGraphQLRequest
(String partialRequest) Get theGraphQLRequest
for the nbBoards executor, created with the given Partial request.Get theBuilder
for the Integer, as expected by the nbBoards query.Get theBuilder
for a full request, as expected by the exec and execWithBindValues methods.getTopicsGraphQLRequest
(String partialRequest) Get theGraphQLRequest
for the topics executor, created with the given Partial request.Get theBuilder
for the Topic, as expected by the topics query.nbBoards
(ObjectResponse objectResponse, Object... paramsAndValues) This method is expected by the graphql-java framework.This method executes a partial query against the GraphQL server.nbBoardsWithBindValues
(ObjectResponse objectResponse, Map<String, Object> parameters) This method is expected by the graphql-java framework.nbBoardsWithBindValues
(String queryResponseDef, Map<String, Object> parameters) This method executes a partial query against the GraphQL server.topics
(ObjectResponse objectResponse, String boardName, Object... paramsAndValues) This method is expected by the graphql-java framework.This method executes a partial query against the GraphQL server.topicsWithBindValues
(ObjectResponse objectResponse, String boardName, Map<String, Object> parameters) This method is expected by the graphql-java framework.This method executes a partial query against the GraphQL server.
-
Constructor Details
-
QueryExecutorMySchema
public QueryExecutorMySchema()
-
-
Method Details
-
execWithBindValues
public QueryResponse execWithBindValues(String queryResponseDef, Map<String, Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationExceptionThis method takes a full request definition, and executes the it against the GraphQL server. That is, the query contains the full string that follows the query/mutation/subscription keyword.
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
For instance:Map<String, Object> params = new HashMap<>(); params.put("heroParam", heroParamValue); params.put("skip", Boolean.FALSE); MyQueryType response = myQueryType.execWithBindValues( "{hero(param:?heroParam) @include(if:true) {id name @skip(if: ?skip) appearsIn friends {id name}}}", params); Character c = response.getHero();
- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above). It must ommit the query/mutation/subscription keyword, and start by the first { that follows.It may contain directives, as explained in the GraphQL specs.parameters
- The map of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
. The key is the parameter name, as defined in the query (in the above sample: heroParam is an optional parameter and skip is a mandatory one). The value is the parameter vale in its Java type (for instance aDate
for theGraphQLScalarTypeDate
). The parameters which value is missing in this map will no be transmitted toward the GraphQL server.- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
exec
public QueryResponse exec(String queryResponseDef, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException This method takes a full request definition, and executes it against the GraphQL server. That is, the query contains the full string that follows the query/mutation/subscription keyword.
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
For instance:MyQueryType response = myQueryType.execWithBindValues( "{hero(param:?heroParam) @include(if:true) {id name @skip(if: ?skip) appearsIn friends {id name}}}", "heroParam", heroParamValue, "skip", Boolean.FALSE); Character c = response.getHero();
- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above). It must ommit the query/mutation/subscription keyword, and start by the first { that follows.It may contain directives, as explained in the GraphQL specs.paramsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
execWithBindValues
public QueryResponse execWithBindValues(ObjectResponse objectResponse, Map<String, Object> parameters) throws GraphQLRequestExecutionExceptionThis method takes a full request definition, and executes it against the GraphQL server. That is, the query contains the full string that follows the query/mutation/subscription keyword.
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
For instance:ObjectResponse response; public void setup() { // Preparation of the query objectResponse = myQueryType.getResponseBuilder() .withQueryResponseDef("{hero(param:?heroParam) @include(if:true) {id name @skip(if: ?skip) appearsIn friends {id name}}}").build(); } public void doTheJob() { .. Map<String, Object> params = new HashMap<>(); params.put("heroParam", heroParamValue); params.put("skip", Boolean.FALSE); // This will set the value sinceValue to the sinceParam field parameter MyQueryType response = queryType.execWithBindValues(objectResponse, params); Character c = response.getHero(); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
exec
public QueryResponse exec(ObjectResponse objectResponse, Object... paramsAndValues) throws GraphQLRequestExecutionException This method takes a full request definition, and executes it against the GraphQL server. That is, the query contains the full string that follows the query/mutation/subscription keyword.
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
For instance:ObjectResponse response; public void setup() { // Preparation of the query objectResponse = myQueryType.getResponseBuilder() .withQueryResponseDef("{hero(param:?heroParam) @include(if:true) {id name @skip(if: ?skip) appearsIn friends {id name}}}").build(); } public void doTheJob() { .. // This will set the value sinceValue to the sinceParam field parameter MyQueryType response = queryType.exec(objectResponse, "heroParam", heroParamValue, "skip", Boolean.FALSE); Character c = response.getHero(); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparamsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
getResponseBuilder
Get theBuilder
for a full request, as expected by the exec and execWithBindValues methods.- Returns:
- Throws:
GraphQLRequestPreparationException
-
getGraphQLRequest
public GraphQLRequest getGraphQLRequest(String fullRequest) throws GraphQLRequestPreparationException Get theGraphQLRequest
for full request. For instance:GraphQLRequest request = new GraphQLRequest(fullRequest);
- Parameters:
fullRequest
- The full GraphQLRequest, as specified in the GraphQL specification- Returns:
- Throws:
GraphQLRequestPreparationException
-
boardsWithBindValues
public List<Board> boardsWithBindValues(String queryResponseDef, Map<String, Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationExceptionThis method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):Map<String, Object> params = new HashMap<>(); params.put("skip", Boolean.FALSE); List
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).c = myQyeryType.boardsWithBindValues("{id name @skip(if: false) appearsIn friends {id name}}", params);
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)parameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
boards
public List<Board> boards(String queryResponseDef, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException This method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):List
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).c = myQyeryType.boards("{id name @skip(if: false) appearsIn friends {id name}}", "skip", Boolean.FALSE);
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)parameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
boardsWithBindValues
public List<Board> boardsWithBindValues(ObjectResponse objectResponse, Map<String, Object> parameters) throws GraphQLRequestExecutionExceptionThis method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. Map<String, Object> params = new HashMap<>(); params.put("sinceParam", sinceValue); // This will set the value sinceValue to the sinceParam field parameter List
ret = queryType.boardsWithBindValues(response, params); ... } - Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
boards
public List<Board> boards(ObjectResponse objectResponse, Object... paramsAndValues) throws GraphQLRequestExecutionException This method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. // This will set the value sinceValue to the sinceParam field parameter List
ret = queryType.boards(response, "sinceParam", sinceValue); ... } - Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparamsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
getBoardsResponseBuilder
Get theBuilder
for the Board, as expected by the boards query.- Returns:
- Throws:
GraphQLRequestPreparationException
-
getBoardsGraphQLRequest
public GraphQLRequest getBoardsGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException Get theGraphQLRequest
for the boards executor, created with the given Partial request.- Parameters:
partialRequest
- The Partial GraphQLRequest, as explained in the plugin client documentation- Returns:
- Throws:
GraphQLRequestPreparationException
-
nbBoardsWithBindValues
public Integer nbBoardsWithBindValues(String queryResponseDef, Map<String, Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationExceptionThis method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):Map<String, Object> params = new HashMap<>(); params.put("skip", Boolean.FALSE); Integer c = myQyeryType.nbBoardsWithBindValues("{id name @skip(if: false) appearsIn friends {id name}}", params);
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)parameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
nbBoards
public Integer nbBoards(String queryResponseDef, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException This method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):Integer c = myQyeryType.nbBoards("{id name @skip(if: false) appearsIn friends {id name}}", "skip", Boolean.FALSE);
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)parameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
nbBoardsWithBindValues
public Integer nbBoardsWithBindValues(ObjectResponse objectResponse, Map<String, Object> parameters) throws GraphQLRequestExecutionExceptionThis method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. Map<String, Object> params = new HashMap<>(); params.put("sinceParam", sinceValue); // This will set the value sinceValue to the sinceParam field parameter Integer ret = queryType.nbBoardsWithBindValues(response, params); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
nbBoards
public Integer nbBoards(ObjectResponse objectResponse, Object... paramsAndValues) throws GraphQLRequestExecutionException This method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. // This will set the value sinceValue to the sinceParam field parameter Integer ret = queryType.nbBoards(response, "sinceParam", sinceValue); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparamsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
getNbBoardsResponseBuilder
Get theBuilder
for the Integer, as expected by the nbBoards query.- Returns:
- Throws:
GraphQLRequestPreparationException
-
getNbBoardsGraphQLRequest
public GraphQLRequest getNbBoardsGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException Get theGraphQLRequest
for the nbBoards executor, created with the given Partial request.- Parameters:
partialRequest
- The Partial GraphQLRequest, as explained in the plugin client documentation- Returns:
- Throws:
GraphQLRequestPreparationException
-
topicsWithBindValues
public List<Topic> topicsWithBindValues(String queryResponseDef, String boardName, Map<String, Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationExceptionThis method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):Map<String, Object> params = new HashMap<>(); params.put("skip", Boolean.FALSE); List
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).c = myQyeryType.topicsWithBindValues("{id name @skip(if: false) appearsIn friends {id name}}", boardName, params);
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)boardName
- Parameter for the topics field of Query, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
topics
public List<Topic> topics(String queryResponseDef, String boardName, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException This method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):List
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).c = myQyeryType.topics("{id name @skip(if: false) appearsIn friends {id name}}", boardName, "skip", Boolean.FALSE);
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)boardName
- Parameter for the topics field of Query, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
topicsWithBindValues
public List<Topic> topicsWithBindValues(ObjectResponse objectResponse, String boardName, Map<String, Object> parameters) throws GraphQLRequestExecutionExceptionThis method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. Map<String, Object> params = new HashMap<>(); params.put("sinceParam", sinceValue); // This will set the value sinceValue to the sinceParam field parameter List
ret = queryType.topicsWithBindValues(response, boardName, params); ... } - Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnboardName
- Parameter for the topics field of Query, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
topics
public List<Topic> topics(ObjectResponse objectResponse, String boardName, Object... paramsAndValues) throws GraphQLRequestExecutionException This method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. // This will set the value sinceValue to the sinceParam field parameter List
ret = queryType.topics(response, boardName, "sinceParam", sinceValue); ... } - Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnboardName
- Parameter for the topics field of Query, as defined in the GraphQL schemaparamsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
getTopicsResponseBuilder
Get theBuilder
for the Topic, as expected by the topics query.- Returns:
- Throws:
GraphQLRequestPreparationException
-
getTopicsGraphQLRequest
public GraphQLRequest getTopicsGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException Get theGraphQLRequest
for the topics executor, created with the given Partial request.- Parameters:
partialRequest
- The Partial GraphQLRequest, as explained in the plugin client documentation- Returns:
- Throws:
GraphQLRequestPreparationException
-
findTopicsWithBindValues
public List<Topic> findTopicsWithBindValues(String queryResponseDef, String boardName, List<String> keyword, Map<String, Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationExceptionThis method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):Map<String, Object> params = new HashMap<>(); params.put("skip", Boolean.FALSE); List
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).c = myQyeryType.findTopicsWithBindValues("{id name @skip(if: false) appearsIn friends {id name}}", boardName, keyword, params);
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)boardName
- Parameter for the findTopics field of Query, as defined in the GraphQL schemakeyword
- Parameter for the findTopics field of Query, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
findTopics
public List<Topic> findTopics(String queryResponseDef, String boardName, List<String> keyword, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException This method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):List
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).c = myQyeryType.findTopics("{id name @skip(if: false) appearsIn friends {id name}}", boardName, keyword, "skip", Boolean.FALSE);
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)boardName
- Parameter for the findTopics field of Query, as defined in the GraphQL schemakeyword
- Parameter for the findTopics field of Query, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
findTopicsWithBindValues
public List<Topic> findTopicsWithBindValues(ObjectResponse objectResponse, String boardName, List<String> keyword, Map<String, Object> parameters) throws GraphQLRequestExecutionExceptionThis method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. Map<String, Object> params = new HashMap<>(); params.put("sinceParam", sinceValue); // This will set the value sinceValue to the sinceParam field parameter List
ret = queryType.findTopicsWithBindValues(response, boardName, keyword, params); ... } - Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnboardName
- Parameter for the findTopics field of Query, as defined in the GraphQL schemakeyword
- Parameter for the findTopics field of Query, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
findTopics
public List<Topic> findTopics(ObjectResponse objectResponse, String boardName, List<String> keyword, Object... paramsAndValues) throws GraphQLRequestExecutionException This method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. // This will set the value sinceValue to the sinceParam field parameter List
ret = queryType.findTopics(response, boardName, keyword, "sinceParam", sinceValue); ... } - Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnboardName
- Parameter for the findTopics field of Query, as defined in the GraphQL schemakeyword
- Parameter for the findTopics field of Query, as defined in the GraphQL schemaparamsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
getFindTopicsResponseBuilder
Get theBuilder
for the Topic, as expected by the findTopics query.- Returns:
- Throws:
GraphQLRequestPreparationException
-
getFindTopicsGraphQLRequest
public GraphQLRequest getFindTopicsGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException Get theGraphQLRequest
for the findTopics executor, created with the given Partial request.- Parameters:
partialRequest
- The Partial GraphQLRequest, as explained in the plugin client documentation- Returns:
- Throws:
GraphQLRequestPreparationException
-
__schemaWithBindValues
public __Schema __schemaWithBindValues(String queryResponseDef, Map<String, Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationExceptionThis method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):Map<String, Object> params = new HashMap<>(); params.put("skip", Boolean.FALSE); __Schema c = myQyeryType.__schemaWithBindValues("{id name @skip(if: false) appearsIn friends {id name}}", params);
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)parameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
__schema
public __Schema __schema(String queryResponseDef, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException This method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):__Schema c = myQyeryType.__schema("{id name @skip(if: false) appearsIn friends {id name}}", "skip", Boolean.FALSE);
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)parameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
__schemaWithBindValues
public __Schema __schemaWithBindValues(ObjectResponse objectResponse, Map<String, Object> parameters) throws GraphQLRequestExecutionExceptionThis method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. Map<String, Object> params = new HashMap<>(); params.put("sinceParam", sinceValue); // This will set the value sinceValue to the sinceParam field parameter __Schema ret = queryType.__schemaWithBindValues(response, params); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
__schema
public __Schema __schema(ObjectResponse objectResponse, Object... paramsAndValues) throws GraphQLRequestExecutionException This method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. // This will set the value sinceValue to the sinceParam field parameter __Schema ret = queryType.__schema(response, "sinceParam", sinceValue); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparamsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
get__schemaResponseBuilder
Get theBuilder
for the __Schema, as expected by the __schema query.- Returns:
- Throws:
GraphQLRequestPreparationException
-
get__schemaGraphQLRequest
public GraphQLRequest get__schemaGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException Get theGraphQLRequest
for the __schema executor, created with the given Partial request.- Parameters:
partialRequest
- The Partial GraphQLRequest, as explained in the plugin client documentation- Returns:
- Throws:
GraphQLRequestPreparationException
-
__typeWithBindValues
public __Type __typeWithBindValues(String queryResponseDef, String name, Map<String, Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationExceptionThis method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):Map<String, Object> params = new HashMap<>(); params.put("skip", Boolean.FALSE); __Type c = myQyeryType.__typeWithBindValues("{id name @skip(if: false) appearsIn friends {id name}}", name, params);
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)name
- Parameter for the __type field of Query, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
__type
public __Type __type(String queryResponseDef, String name, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException This method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):__Type c = myQyeryType.__type("{id name @skip(if: false) appearsIn friends {id name}}", name, "skip", Boolean.FALSE);
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)name
- Parameter for the __type field of Query, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
__typeWithBindValues
public __Type __typeWithBindValues(ObjectResponse objectResponse, String name, Map<String, Object> parameters) throws GraphQLRequestExecutionExceptionThis method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. Map<String, Object> params = new HashMap<>(); params.put("sinceParam", sinceValue); // This will set the value sinceValue to the sinceParam field parameter __Type ret = queryType.__typeWithBindValues(response, name, params); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnname
- Parameter for the __type field of Query, as defined in the GraphQL schemaparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
__type
public __Type __type(ObjectResponse objectResponse, String name, Object... paramsAndValues) throws GraphQLRequestExecutionException This method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. // This will set the value sinceValue to the sinceParam field parameter __Type ret = queryType.__type(response, name, "sinceParam", sinceValue); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnname
- Parameter for the __type field of Query, as defined in the GraphQL schemaparamsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
get__typeResponseBuilder
Get theBuilder
for the __Type, as expected by the __type query.- Returns:
- Throws:
GraphQLRequestPreparationException
-
get__typeGraphQLRequest
public GraphQLRequest get__typeGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException Get theGraphQLRequest
for the __type executor, created with the given Partial request.- Parameters:
partialRequest
- The Partial GraphQLRequest, as explained in the plugin client documentation- Returns:
- Throws:
GraphQLRequestPreparationException
-
__typenameWithBindValues
public String __typenameWithBindValues(String queryResponseDef, Map<String, Object> parameters) throws GraphQLRequestExecutionException, GraphQLRequestPreparationExceptionThis method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):Map<String, Object> params = new HashMap<>(); params.put("skip", Boolean.FALSE); String c = myQyeryType.__typenameWithBindValues("{id name @skip(if: false) appearsIn friends {id name}}", params);
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)parameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
__typename
public String __typename(String queryResponseDef, Object... paramsAndValues) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException This method executes a partial query against the GraphQL server. That is, the query that is one of the queries defined in the GraphQL query object. The queryResponseDef contains the part of the query that is after the query name.
For instance, if the query hero has one parameter (as defined in the GraphQL schema):String c = myQyeryType.__typename("{id name @skip(if: false) appearsIn friends {id name}}", "skip", Boolean.FALSE);
It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method takes care of writing the query name, and the parameter(s) for the query. The given queryResponseDef describes the format of the response of the server response, that is the expected fields of theCharacter
GraphQL type. It can be something like "{ id name }", if you want these fields of this type. Please take a look at the StarWars, Forum and other samples for more complex queries.
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.- Parameters:
queryResponseDef
- The response definition of the query, in the native GraphQL format (see here above)parameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestPreparationException
- When an error occurs during the request preparation, typically when building theObjectResponse
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
__typenameWithBindValues
public String __typenameWithBindValues(ObjectResponse objectResponse, Map<String, Object> parameters) throws GraphQLRequestExecutionExceptionThis method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. Map<String, Object> params = new HashMap<>(); params.put("sinceParam", sinceValue); // This will set the value sinceValue to the sinceParam field parameter String ret = queryType.__typenameWithBindValues(response, params); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparameters
- The list of values, for the bind variables defined in the query. If there is no bind variable in the defined Query, this argument may be null or an emptyMap
- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
__typename
public String __typename(ObjectResponse objectResponse, Object... paramsAndValues) throws GraphQLRequestExecutionException This method is expected by the graphql-java framework. It will be called when this query is called. It offers a logging of the call (if in debug mode), or of the call and its parameters (if in trace mode).
This method is valid for queries/mutations/subscriptions which don't have bind variables, as there is no parameters argument to pass the list of values.
Here is a sample:ObjectResponse response; public void setup() { // Preparation of the query response = queryType.getBoardsResponseBuilder() .withQueryResponseDef("{id name publiclyAvailable topics(since:?sinceParam){id}}").build(); } public void doTheJob() { .. // This will set the value sinceValue to the sinceParam field parameter String ret = queryType.__typename(response, "sinceParam", sinceValue); ... }
- Parameters:
objectResponse
- The definition of the response format, that describes what the GraphQL server is expected to returnparamsAndValues
- This parameter contains all the name and values for the Bind Variables defined in the objectResponse parameter, that must be sent to the server. Optional parameter may not have a value. They will be ignored and not sent to the server. Mandatory parameter must be provided in this argument.
This parameter contains an even number of parameters: it must be a series of name and values : (paramName1, paramValue1, paramName2, paramValue2...)- Throws:
GraphQLRequestExecutionException
- When an error occurs during the request execution, typically a network error, an error from the GraphQL server or if the server response can't be parsed
-
get__typenameResponseBuilder
Get theBuilder
for the String, as expected by the __typename query.- Returns:
- Throws:
GraphQLRequestPreparationException
-
get__typenameGraphQLRequest
public GraphQLRequest get__typenameGraphQLRequest(String partialRequest) throws GraphQLRequestPreparationException Get theGraphQLRequest
for the __typename executor, created with the given Partial request.- Parameters:
partialRequest
- The Partial GraphQLRequest, as explained in the plugin client documentation- Returns:
- Throws:
GraphQLRequestPreparationException
-