Class GraphQLUtils


  • @Internal
    public class GraphQLUtils
    extends Object
    Helper methods for building GraphQL request strings.
    Since:
    6.12.0
    • Constructor Detail

      • GraphQLUtils

        public GraphQLUtils()
    • Method Detail

      • 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 graph
        queryFragment - The graphql query fragment that within the query field name
        arguments - 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 graph
        queryFragment - The graphql query fragment that resides within the query field name
        arguments - The arguments to the query field
        Returns:
        The query string
      • buildRequestString

        public static String buildRequestString​(String query)
        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

        public static String buildGraphQLFieldArgumentsString​(Map<String,​Object> arguments)
        Get a string with graph-ql field arguments, suitable for use in a graph-ql query string.