Class GraphQLUtils
java.lang.Object
com.atlassian.confluence.rest.client.graphql.GraphQLUtils
Helper methods for building GraphQL request strings.
- Since:
- 9.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
buildGraphQLFieldArgumentsString
(Map<String, Object> arguments) Get a string with graph-ql field arguments, suitable for use in a graph-ql query string.static String
Build a GraphQL query string from a field name, query arguments and query body fragment.static String
buildRequestString
(String query) Build a request string for a graph-ql REST API request.static String
Build a request string for a graph-ql REST API request.
-
Constructor Details
-
GraphQLUtils
public GraphQLUtils()
-
-
Method Details
-
buildRequestString
public static String buildRequestString(String queryFieldName, String queryFragment, Map<String, Object> arguments) Build a request string for a graph-ql REST API request.- Parameters:
queryFieldName
- The name of the query field in the graphqueryFragment
- The graphql query fragment that within the query field namearguments
- The arguments to the query field- Returns:
- The request string, suitable for passing to the body of a graphql REST endpoint
-
buildQuery
public static String buildQuery(String queryFieldName, String queryFragment, Map<String, Object> arguments) Build a GraphQL query string from a field name, query arguments and query body fragment.- Parameters:
queryFieldName
- The name of the query field in the graphqueryFragment
- The graphql query fragment that resides within the query field namearguments
- The arguments to the query field- Returns:
- The query string
-
buildRequestString
Build a request string for a graph-ql REST API request.- Parameters:
query
- The GraphQL query- Returns:
- The request string, suitable for passing to the body of a graphql REST endpoint
-
buildGraphQLFieldArgumentsString
Get a string with graph-ql field arguments, suitable for use in a graph-ql query string.
-